September 21, 2004, 01:30 PM
pruittlrGraph with month as across field
I'm using WebFOCUS 5.21 on Windows NT.
I have a graph that has an across by month. The problem is the month is a number and I need the 3 character abbreviation to show on the display. For 01, I want Jan, 02 Feb, etc. Here's part of my define.
MYDT/MDYY=DATE;
MYMONTHI/M=MYDT;
MYMONTH/A3=DECODE MYMONTHI(1 'JAN' 2 'FEB' 3 'MAR' 4 'APR' 5 'MAY' 6 'JUN' 7 'JUL' 8 'AUG' 9 'SEP' 10 'OCT' 11 'NOV' 12 'DEC');
The graph statement is ACROSS MYMONTH which makes the sort on the alphanumeric month instead of the numeric month. Naturally I want the order to be Jan, Feb, Mar, etc.
Is there a way to sort it by the numeric month but display the alphanumeric representation?
Thanks,
Raelene
September 21, 2004, 02:17 PM
Lenny WardYou can use 'COLUMNS'
Using your DEFINES
ACROSS MYMONTH
COLUMNS JAN AND FEB AND MAR AND APR ....
September 21, 2004, 02:25 PM
pruittlrThanks, it worked like a charm. Hadn't heard of COLUMNS, but then I'm pretty new at building graphs.
Thanks again.
September 21, 2004, 02:59 PM
<Kyle>Why don't you just change MYMONTHI/M=MYDT to MYMONTHI/MT=MYDT. This will set the MYMONTHI field equal to the 3 character values you are manually setting in your define. See my example:
SET LOOKGRAPH=LINE
DEFINE FILE CENTORD
3MONTH/Mt=ORDER_DATE;
END
GRAPH FILE CENTORD
SUM LINEPRICE
ACROSS 3MONTH
END