To sort by SALES_AWARD_NAME_SORT but display SALES_AWARD_NAME in correct order within the legend
My database administrator established the sort field and would like me to use it instead of relying on another method in which leading spaces are placed in front of the award name to create the custom sort.
My Code Thus Far:
GRAPH FILE COMPHOLD
-* Created by Info Assist for Graph
SUM HEADCOUNT AS 'Percentage'
BY SALES_AWARD_NAME_SORT NOPRINT
ACROSS YEAR AS 'Sales Year'
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET GRMERGE ON
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 2
ON GRAPH SET GRXAXIS 0
ON GRAPH SET STYLE *
What I've Done:
So far, I’ve studied several postings on the forum including:
[SOLVED]Sorting Graph with NOPRINT field posted April 7, 2016
[SOLVED] Graph SORT field in legend with NOPRINT posted Jan. 15, 2015
[Solved] Bar Graph -- I want to sort bars, but not show sort field posted March 1, 2012
[SOLVED] Order By BarCharts posted Oct. 12, 2009
I am probably overlooking something easy. Can anyone point me in the right direction or to another post on the subject? I've ran several searches, and I've not yet hit on the right post or solution.This message has been edited. Last edited by: <Emily McAllister>,
I've encountered this situation several times in the past and the only technique I could find was the leading blanks hack. It can be coded so that you generate your own blanks based on the DBA's provided field. The following is an example that graphs across state but sorts by the region. Hopefully you can run my example and then apply the technique to your situation.
DEFINE FUNCTION LeadSpace(Indent/I9,String/A50) Chars/A50 = '**************************************************'; LenChars/A50 = SUBSTR(100,Chars,1,100,Indent,'A50'); LenString/A100 = LenChars || String; LeadSpace/A100 = STRREP(200,LenString,1,'*',1,' ',100,'A100'); END TABLE FILE GGSALES SUM UNITS COMPUTE N/I9 = IF LAST REGION EQ REGION THEN N ELSE N + 1; COMPUTE STATE/A100 = LeadSpace(N,ST); COMPUTE DATEYY/YY = DATE; BY REGION BY ST BY DATE ON TABLE HOLD AS CHARTDATA END GRAPH FILE CHARTDATA SUM UNITS BY DATEYY ACROSS STATE ON GRAPH PCHOLD FORMAT JSCHART ON GRAPH SET LOOKGRAPH VBAR ON GRAPH SET HTMLENCODE ON ON GRAPH SET GRMERGE ON ON GRAPH SET GRLEGEND 2 END
Win10 / IE11
AHTML EXL2K PDF
|Powered by Social Strata|