Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


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

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[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: 191 | Registered: September 18, 2015Report 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
  


WebFOCUS 8.2.06
 
Posts: 210 | Location: Sterling Heights, Michigan | Registered: October 19, 2010Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

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-2020 Information Builders