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     Ranking items in a graph.

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Ranking items in a graph.
 Login/Join
 
Member
posted
I am working a graph showing the efficiency of individual departments on a bar graph. Our management would like to see the graph sorted with the most efficient dept first followed by the second most efficient dept and so on until you reach the least efficient. Is it possible and if so how would you do it?
 
Posts: 18 | Registered: March 13, 2007Report This Post
Expert
posted Hide Post
The column that measures the efficiency would be the ACROSS column:

ACROSS HIGHEST EFFICIENCY_RATE


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
Nicholas,
You want to see the bars in descending order of the efficiency with the appropriate department labels.
So there is a bit more coding to do.
-* File NICHOLAS.fex
TABLE FILE CAR
SUM SALES
RANKED BY HIGHEST TOTAL SALES BY CAR
WHERE SALES GT 0;
ON TABLE HOLD
END
TABLE FILE HOLD
PRINT CAR
ON TABLE SAVE
END
-RUN
-SET &LABS=&RECORDS;
-REPEAT #GLABELS FOR &I FROM 1 TO &LABS;
-READ SAVE,&LAB
-SET &LAB.&I=&LAB;
-#GLABELS
-RUN
GRAPH FILE HOLD
SUM SALES
ACROSS CAR COLUMNS
-REPEAT #COLS FOR &I FROM 1 TO &LABS
-SET &AND=IF &I NE &LABS THEN 'AND' ELSE ' ';
'&LAB.&I' &AND
-#COLS
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);
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);
setTextJustHoriz(getO1Title(),1);
setFontSizeAbsolute(getO1Title(),true);
setFontSize(getO1Title(),12);
setTextRotation(getO1Title(),0);
setTextWrap(getO1Title(),false);
setTextJustHoriz(getO1Label(),2);
setFontSizeAbsolute(getO1Label(),true);
setFontSize(getO1Label(),14);
setFontStyle(getO1Label(),2);
setFillColor(getO1Label(),new Color(255,0,0));
setTextRotation(getO1Label(),3);
setTextWrap(getO1Label(),false);
setPlaceResize(getO1Title(),0);
setPlaceRotate(getO1Title(),0);
setPlaceAlign(getO1Title(),0);
setPlaceWordWrap(getO1Title(),0);
setPlaceResize(getO1Label(),0);
setPlaceRotate(getO1Label(),0);
setPlaceAlign(getO1Label(),0);
setPlaceWordWrap(getO1Label(),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,
$
TYPE=REPORT,
     GRID=OFF,
     FONT='TIMES NEW ROMAN',
     SIZE=10,
     BACKCOLOR='NONE',
     STYLE=NORMAL,
$
ENDSTYLE
END


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Gold member
posted Hide Post
By default graphs are ranked by the primary sort field so to do what you want has to be done in a couple of stages. A sample using the CAR file is below.

SET ASNAMES = ON
TABLE FILE CAR
SUM RETAIL_COST/I7 AS 'COST'
BY COUNTRY
ON TABLE HOLD AS TEMPCAR
END
-RUN

TABLE FILE TEMPCAR
SUM COST
RANKED BY HIGHEST COST
BY COUNTRY
ON TABLE HOLD AS TEMPCAR1
END
-RUN

GRAPH FILE TEMPCAR1
SUM COST
BY RANK
BY COUNTRY
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB ON
ON GRAPH SET 3D ON
ON GRAPH SET VZERO ON
ON GRAPH SET GRID ON
ON GRAPH SET VAXIS 400
ON GRAPH SET HAXIS 800
ON GRAPH SET GRMERGE ON
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHSTYLE *
setY1LabelRotate(3);
setDataTextFormat(1);
setDataTextDisplay(true);
setMarkerDisplay(true);
setConnectLineMarkers(false);
setConnectScatterMarkers(false);
setO1LabelDisplay(true);
setO1AxisSide(0);
setO1MajorGridDisplay(false);
setO1MinorGridDisplay(false);
setAxisAssignment(0,0);
setY1LabelDisplay(true);
setY1AxisSide(0);
setY1MajorGridDisplay(true);
setY1MajorGridStyle(0);
setY1MinorGridDisplay(false);
setTextFormatPreset(getY1Label(),-1);
setTextFormatPattern(getY1Label(),"#.##");
setLegendDisplay(true);
setFontSizeAbsolute(getY1Title(),true);
setFontSizeAbsolute(getY1Label(),true);
setFontSizeAbsolute(getY2Title(),true);
setFontSizeAbsolute(getY2Label(),true);
setTextJustHoriz(getO1Title(),1);
setFontSizeAbsolute(getO1Title(),true);
setFontSize(getO1Title(),12);
setTextRotation(getO1Title(),0);
setTextWrap(getO1Title(),false);
setTextRotation(getO1Label(),3);
setPlaceResize(getO1Title(),0);
setPlaceRotate(getO1Title(),0);
setPlaceAlign(getO1Title(),0);
setPlaceWordWrap(getO1Title(),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,
$
TYPE=REPORT,
GRID=OFF,
FONT='TIMES NEW ROMAN',
SIZE=10,
COLOR=RGB(255 224 193),
BACKCOLOR='NONE',
STYLE=NORMAL,
$
TYPE=HEADING,
LINE=1,
JUSTIFY=CENTER,
$
TYPE=HEADING,
LINE=1,
OBJECT=TEXT,
ITEM=1,
FONT='ARIAL',
SIZE=12,
COLOR='BLACK',
STYLE=BOLD,
$
TYPE=HEADING,
LINE=2,
JUSTIFY=CENTER,
$
TYPE=HEADING,
LINE=2,
OBJECT=TEXT,
ITEM=1,
FONT='ARIAL',
COLOR='BLACK',
STYLE=BOLD,
$
TYPE=HEADING,
LINE=3,
JUSTIFY=CENTER,
$
TYPE=HEADING,
LINE=3,
OBJECT=TEXT,
ITEM=1,
FONT='ARIAL',
COLOR='BLACK',
STYLE=BOLD,
$
TYPE=HEADING,
LINE=4,
JUSTIFY=CENTER,
$
TYPE=HEADING,
LINE=4,
OBJECT=TEXT,
ITEM=1,
FONT='ARIAL',
COLOR='BLACK',
STYLE=BOLD,
$
ENDSTYLE
END


WF 7703M, XP/Win7, MRE, RC, BID, PMF, HTML, PDF, Excel 2000/7/10
 
Posts: 73 | Location: NY | Registered: February 06, 2007Report This Post
Member
posted Hide Post
The issue is that you want to sort on department name based on its ranking of efficiency. There may be other ways to do this, but this technique will work:

First write the report that calculates your effciency by the department and HOLD it. Here is an example of a calculation on the CAR file:

TABLE FILE CAR
SUM RCOST DCOST COMPUTE RATIO/D12.2 = RCOST/DCOST;
BY COUNTRY
ON TABLE HOLD
END

Then re-sort that file by the calculated field and HOLD it:

TABLE FILE HOLD
PRINT COUNTRY
BY HIGHEST RATIO
ON TABLE HOLD
END

Then define a counter and concatinate that counter onto the field that you will graph ACROSS to get it to rank correctly:

DEFINE FILE HOLD
CNTR/I2 WITH COUNTRY = CNTR + 1;
NEWCOUNTRY/A24 = EDIT(CNTR) || COUNTRY;
END

And then produce the graph:

GRAPH FILE HOLD
SUM RATIO ACROSS NEWCOUNTRY
END

The issue with this technique in your case is that each department will have a number prefixed to its name.
 
Posts: 4 | Registered: March 23, 2007Report This Post
<Shane>
posted
Danny-SRL,

Your solution worked for my scenario which was similar to Nicholas'. However, when there is a value on the x-axis with blanks, it displays it in the correct position, but with a 0 value.

Shane
 
Report 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     Ranking items in a graph.

Copyright © 1996-2020 Information Builders