Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED]CUSTOM SORT A LEGEND on VBAR GRAPH
Go
New
Search
Notify
Tools
Reply
  
[CLOSED]CUSTOM SORT A LEGEND on VBAR GRAPH
 Login/Join
 
Platinum Member
posted
Objective:

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
BY SALES_AWARD_NAME
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>,


WebFocus 8.2.04
WebFocus 8.2.04

 
Posts: 169 | Registered: September 18, 2015Reply With QuoteReport This Post
Platinum Member
posted Hide Post
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
  


WF 8.2.06
Win10 / IE11
AHTML EXL2K PDF
 
Posts: 147 | Registered: October 19, 2010Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED]CUSTOM SORT A LEGEND on VBAR GRAPH

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.