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     [SOLVED] Ranking an aggregate table by a percent column

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Ranking an aggregate table by a percent column
 Login/Join
 
Gold member
posted
Hey everyone - hoping someone can help. I'm on the final step of a small report that ended up being a bigger pain than I expected. My scenario is this: For each "branch" we have, they can receive orders either via the web or not. I needed to determine what percent of that branch's total orders was web-based or "WOE". The higher the percentage the better. My last step is to rank the branches based on who has the highest percentage of these WOE orders. I've researched RANK and BY TOTAL, but I'm not getting the right results. Can someone help? Here is my code:

DEFINE FILE SALES_CURR_FY_US
TYPE/A10=
IF REMOTE_DATA = 'IX' OR 'WOE' THEN 'WOE'
ELSE
'NON-WOE';
END
TABLE FILE SALES_CURR_FY_US
SUM 
     'CNT.SALES_CURR_FY_US.SALES_CURR_FY_US.ORDER_NUM' NOPRINT
 AS 'ORDER COUNTER'
     'PCT.CNT.SALES_CURR_FY_US.SALES_CURR_FY_US.ORDER_NUM'  WITHIN PRICING_BRANCH
 AS '% WOE'
BY 'SALES_CURR_FY_US.SALES_CURR_FY_US.PRICING_BRANCH' AS 'BRANCH'
BY 'SALES_CURR_FY_US.SALES_CURR_FY_US.TYPE' NOPRINT
HEADING
""
FOOTING
""
WHERE ( SALES_CURR_FY_US.SALES_CURR_FY_US.GL_DATE_MDYY GE '12/01/2010' ) AND ( SALES_CURR_FY_US.SALES_CURR_FY_US.GL_DATE_MDYY LE '12/31/2010' );
WHERE TOTAL TYPE EQ 'WOE';
ON TABLE SET PAGE-NUM OFF 
ON TABLE SET BYDISPLAY ON 
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
     PAGECOLOR='WHITE',
$
     GRAPHTYPE=DATA,
     COLUMN=N5,
     GRAPHCOLOR='MAROON',  
.
.
.



Thank you!
Jeralee
..

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


WebFOCUS 7.7.03
Linux / Universe Db
HTML/PDF/EXCEL/HTML Active
 
Posts: 90 | Registered: November 03, 2009Report This Post
Expert
posted Hide Post
Hi Jeralee,

Can you please try the following code from our internals:

APP HOLD SORT
SET HOLDLIST=PRINTONLY
SET ASNAMES=ON
DEFINE FILE CAR
TYPE/A10= 
IF SEATS GT 4 THEN 'WOE'
ELSE
'NON-WOE';
END
TABLE FILE CAR
SUM RCOST NOPRINT
BY COUNTRY  
SUM
    RCOST NOPRINT 
COMPUTE PCT_OF_BRANCH/P6.2=(C2/C1)* 100;
BY COUNTRY AS 'BRANCH'
BY TYPE
ON TABLE PCHOLD FORMAT HTML
END
HOLD AS BRANCHSORT
TABLE FILE BRANCHSORT
PRINT  PCT_OF_BRANCH
BRANCH     
BY HIGHEST TYPE          
BY HIGHEST PCT_OF_BRANCH NOPRINT
END


Cheers,
Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.
 
Posts: 1948 | Location: New York | Registered: November 16, 2004Report This Post
Gold member
posted Hide Post
I ran this code and got results, but they are not what I'm looking for...my output currently looks like this:

BRANCH PCT_WOE (visualize)
10 38.88
11 48.98
12 55.00
13 21.00
31 98.88


So - what I need is for branch 31 to be at the top with 98.88% and then branch 12 (and so on).

I tried just the hold portion of the code you provided to see if I could get that to work at the end of my procedure. It didn't error on me, but didn't give me the desired results.

Please forgive my rookie response - I may not be understanding the guidance you are trying to give.

Thank you,
Jeralee


WebFOCUS 7.7.03
Linux / Universe Db
HTML/PDF/EXCEL/HTML Active
 
Posts: 90 | Registered: November 03, 2009Report This Post
Gold member
posted Hide Post
I DID figure it out using a hold file as you suggest above!!! Thank you for guiding me that way! I had considered it before but didn't get it working. I didn't have SET ASNAMES = ON and I think that may have been throwing me off.

Anyway - problem solved! Thank you!


WebFOCUS 7.7.03
Linux / Universe Db
HTML/PDF/EXCEL/HTML Active
 
Posts: 90 | Registered: November 03, 2009Report 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     [SOLVED] Ranking an aggregate table by a percent column

Copyright © 1996-2020 Information Builders