Focal Point
[CLOSED] Sorting in a graph

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

February 05, 2010, 10:27 AM
saggy
[CLOSED] Sorting in a graph
I have a graph in which i display a count by month and in this graph i want to have the months in the order of their calendar appearance like jan comes first feb next and so on.but the SQL passthru Query returns them in random order.Is there any way to fix this.

This message has been edited. Last edited by: Kerry,


7.6.4
Unix & Windows
Excel,HTML,PDF,PPT,AHTML


February 05, 2010, 11:29 AM
GamP
HOLD the results of the SQL Passthru query and then do your graph using the held data.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
February 05, 2010, 11:46 AM
saggy
Thanks GamP for your response.I did try using this approach but it didnt work.Below is what i tried.
DEFINE FILE ca
MNT/A10 = DECODE('JAN' '01'..so on);
END

Table file CAR
sum
X1 By MNT
on HOLD AS V1
END

GRAPH FILE V1
SUM X1
BY MNT
END
-This is wat u meant has to be done ??.If not can u suggest me a working example for this problem.thanks for ur help


7.6.4
Unix & Windows
Excel,HTML,PDF,PPT,AHTML


February 05, 2010, 12:45 PM
dballest
Either put a decode on your SQL statement to mark JAN as 01, FEB as 02 and so on or do a define field. Here's a sample.

DEFINE FILE EMPDATA
MN/M=DATECVT(HIREDATE, 'YMD', 'M');
END

GRAPH FILE EMPDATA
SUM CNT.PIN
ACROSS MN
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D OFF
ON GRAPH SET VZERO ON
ON GRAPH SET GRID ON
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHSTYLE *
setMarkerDisplay(true);
setConnectLineMarkers(false);
setConnectScatterMarkers(false);
setO1LabelDisplay(true);
setO1AxisSide(0);
setO1MajorGridDisplay(true);
setO1MajorGridStyle(0);
setO1MinorGridDisplay(false);
setAxisAssignment(0,0);
setSeriesType(0,1);
setY1LabelDisplay(true);
setY1AxisSide(0);
setY1MajorGridDisplay(true);
setY1MajorGridStyle(0);
setY1MinorGridDisplay(false);
setTextFormatPreset(getY1Label(),-1);
setTextFormatPattern(getY1Label(),"#.##");
setPieFeelerTextDisplay(1);
setPieLabelDisplay(0);
setTextFormatPreset(getPieSliceLabel(),1);
setRiserBorderMode(1);
setSeriesDefaultTransparentBorderColor(true);
setUseSeriesBorderDefaults(true);
setLegendDisplay(true);
setFontSizeAbsolute(getY1Title(),true);
setFontSizeAbsolute(getY1Label(),true);
setFontSizeAbsolute(getY2Title(),true);
setFontSizeAbsolute(getY2Label(),true);
setFontSizeAbsolute(getO1Title(),true);
setPlace(true);
ENDSTYLE
ON GRAPH SET STYLE *
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='TIMES NEW ROMAN',
SIZE=10,
$
ENDSTYLE
END
-EXIT


Dev: WebFOCUS 7.6.10, Data Migrator 7.6.10
QA: WebFOCUS 7.6.10, Data Migrator 7.6.10
Prod: WebFOCUS 7.6.2, Data Migrator 7.6.8
Windows 2K3, Tomcat 5.5.17, IIS 6
Usage: HTML, PDF, Excel, Self-serve, BID and MRE
February 05, 2010, 01:08 PM
GinnyJakes
This question has been asked and answered many times in this Forum. Here is a link for one solution:
http://forums.informationbuild...731008331#5731008331
Try using the Search button and do a search on graph and month or date or some combination and see what you can come up with.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google