Focal Point
Graph - X axis values with dates

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4041079742

September 21, 2007, 01:53 PM
Prasanna
Graph - X axis values with dates
Hi,
I am working in line graph. I need to show the graph with amount spent on different categories based on month of a year. I need to show the month in x axis as
J06 for january 2006, F06 for feburary and so on
Using decode i am able to get J from january and F from February.But when i am showing in the x-axis, it shows only 8 months, since J repeats for Jan,Jun,July.Same with A (august and april).How to handle this in graph. Anybody come across same issue or any previous postings in forum


Dev:
Dev Studio 7.1.6,Report Caster 7.1.1,Servlet
Local:
Dev Studio 7.1.6,Report Caster 7.1.1,Apache 5.0.2,
Win XP


September 21, 2007, 02:06 PM
Leah
Have you tried playing with the display formats of dates to give a shortened version or are you locked in to three character?


Leah
September 24, 2007, 04:36 AM
Prasanna
Hi,
Got one solution. But now i am facing issue because of sorting.I am trying to implement the custom sorting.Tried using "COLUMNS".
  Across DATES6 AS ''
COLUMNS &VAR1 AND &VAR2 AND ..... AND &VAR12

where &VAR is a dialougue manager value. When i ran this it gives EDA crash error.I also tried
&VAR1.EVAL, but still it gives EDA crash error. Any idea how to solve this. meanwhile the solution i found is here. it works fine for me.
DATES1/MtY=IN_DT1;
DATES2/I4MY=DATES1;
DATES3/A10=EDIT(DATES2);
DATES4/A10=SUBSTR(4, DATES3, 1, 2, 2, DATES4);
DATES5/A10=SUBSTR(4, DATES3, 3, 4, 2, DATES4);
DATES6/A20V=IF ( DATES4 EQ '01') THEN ('J'|(SUBSTR(4, DATES3, 3, 4, 2, DATES4))) ELSE IF ( DATES4 EQ '02') THEN ('F'|(SUBSTR(4, DATES3, 3, 4, 2, DATES4)))ELSE IF ( DATES4 EQ '03') THEN (' M'|(SUBSTR(4, DATES3, 3, 4, 2, DATES4))) ELSE IF ( DATES4 EQ '04') THEN ('A'|(SUBSTR(4, DATES3, 3, 4, 2, DATES4)))ELSE IF ( DATES4 EQ '05') THEN ('M'|(SUBSTR(4, DATES3, 3, 4, 2, DATES4))) ELSE IF ( DATES4 EQ '06') THEN ('J'|(SUBSTR(4, DATES3, 3, 4, 2, DATES4))|'')
ELSE IF ( DATES4 EQ '07') THEN (' J'|(SUBSTR(4, DATES3, 3, 4, 2, DATES4))) ELSE IF ( DATES4 EQ '08') THEN (' A'|(SUBSTR(4, DATES3, 3, 4, 2, DATES4)))ELSE IF ( DATES4 EQ '09') THEN ('S'|(SUBSTR(4, DATES3, 3, 4, 2, DATES4))) ELSE IF ( DATES4 EQ '10') THEN ('O'|(SUBSTR(4, DATES3, 3, 4, 2, DATES4)))ELSE IF ( DATES4 EQ '11') THEN ('N'|(SUBSTR(4, DATES3, 3, 4, 2, DATES4))) ELSE ('D'|(SUBSTR(4, DATES3, 3, 4, 2, DATES4)));  



Dev:
Dev Studio 7.1.6,Report Caster 7.1.1,Servlet
Local:
Dev Studio 7.1.6,Report Caster 7.1.1,Apache 5.0.2,
Win XP


September 26, 2007, 07:59 AM
Prasanna
Got a solution. Now it is working. It was there in one of the forum discussion used the logic.
 https://forums.informationbuilders.com/eve/forums/a/tpc/...661097871#9661097871 



Dev:
Dev Studio 7.1.6,Report Caster 7.1.1,Servlet
Local:
Dev Studio 7.1.6,Report Caster 7.1.1,Apache 5.0.2,
Win XP


September 26, 2007, 08:40 AM
FrankDutch
Prasanna

Take a look at this example, it was used for an fiscale year graph but works also for a normal year.


-* File fiscyear.fex
-SET &FSTART1 = '891001';
-SET &FSTART2 = '901001';
-SET &FSTART3 = '911001';
-SET &F1=EDIT('&FSTART1.EVAL','99/99');
-SET &F2=EDIT('&FSTART2.EVAL','99/99');
-*SET &FSTART4 = '20061001';
-*SET &FSTART5 = '20071001';
DEFINE FILE SALHIST
PLOTDATE/YYM=
IF EFFECTDATE GE '&FSTART1' AND EFFECTDATE LT '&FSTART2' THEN EFFECTDATE ELSE
IF EFFECTDATE GE '&FSTART2' AND EFFECTDATE LT '&FSTART3' THEN DATEADD(EFFECTDATE,'Y',-1);
SALEM3/D12=IF EFFECTDATE GE '&FSTART1' AND EFFECTDATE LT '&FSTART2' THEN OLDSALARY ELSE 0;
SALEM2/D12=IF EFFECTDATE GE '&FSTART2' AND EFFECTDATE LT '&FSTART3' THEN OLDSALARY ELSE 0;
md/TRM=EFFECTDATE;
END
TABLE FILE SALHIST
SUM
 SALEM2 SALEM3
-*BY EFFECTDATE
BY PLOTDATE
BY md
ON TABLE HOLD
END
DEFINE FILE HOLD
PM/M=PLOTDATE;
END
-* will give

GRAPH FILE HOLD
SUM SALEM2 AS 'Sales FY &F1' SALEM3 AS 'Sales FY &F2' 
ACROSS PLOTDATE
ON GRAPH SET LOOKGRAPH VLINE
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D OFF
ON GRAPH SET VZERO ON
ON GRAPH SET GRID OFF
ON GRAPH SET VAXIS 400
ON GRAPH SET HAXIS 800
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHSTYLE *
setUseTimeScaleAxis(true);
setLevelInterval(0,6);
setLevelTextFormat(0,1);
setMarkerDisplay(true);
setConnectLineMarkers(true);
setConnectScatterMarkers(true);
setO1LabelDisplay(true);
setO1AxisSide(0);
setO1MajorGridDisplay(false);
setO1MinorGridDisplay(false);
setAxisAssignment(0,0);
setAxisAssignment(1,0);
setY1LabelDisplay(true);
setY1AxisSide(0);
setY1MajorGridDisplay(false);
setY1MinorGridDisplay(false);
setTextFormatPreset(getY1Label(),-1);
setTextFormatPattern(getY1Label(),"#.##");
setPieFeelerTextDisplay(1);
setPieLabelDisplay(0);
setTextFormatPreset(getPieSliceLabel(),1);
setRiserBorderMode(1);
setSeriesDefaultTransparentBorderColor(true);
setUseSeriesBorderDefaults(true);
setLegendDisplay(true);
setTitleString("Fiscal year starting &F1.EVAL \nand starting &F2.EVAL");
setTextJustHoriz(getTitle(),1);
setFontSizeAbsolute(getTitle(),true);
setFontSize(getTitle(),12);
setFillColor(getTitle(),new Color(0,0,128));
setTextRotation(getTitle(),0);
setTextWrap(getTitle(),false);
setTextJustHoriz(getLegendText(),1);
setFontSizeAbsolute(getLegendText(),true);
setFontSize(getLegendText(),12);
setFillColor(getLegendText(),new Color(0,0,128));
setTextRotation(getLegendText(),0);
setTextWrap(getLegendText(),false);
setFontSizeAbsolute(getY1Title(),true);
setFontSizeAbsolute(getY1Label(),true);
setFontSizeAbsolute(getY2Title(),true);
setFontSizeAbsolute(getY2Label(),true);
setFontSizeAbsolute(getO1Title(),true);
setPlaceResize(getTitle(),0);
setPlaceRotate(getTitle(),0);
setPlaceAlign(getTitle(),0);
setPlaceWordWrap(getTitle(),0);
setPlaceResize(getLegendText(),0);
setPlaceRotate(getLegendText(),0);
setPlaceAlign(getLegendText(),0);
setPlaceWordWrap(getLegendText(),0);
setPlace(true);
ENDSTYLE
ON GRAPH SET STYLE *
     PAGESIZE='Letter',
     LEFTMARGIN=0.250000,
     RIGHTMARGIN=0.250000,
     TOPMARGIN=0.250000,
     BOTTOMMARGIN=0.250000,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
     TITLETEXT='Fiscal year starting &F1.EVAL',
$
TYPE=REPORT,
     GRID=OFF,
     FONT='TIMES NEW ROMAN',
     SIZE=10,
     BACKCOLOR='NONE',
     STYLE=NORMAL,
$
ENDSTYLE
END


If you use a smartdate for the date field the sorting is done as it should be.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7