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.
You can use BY TOP n (or BY HIGHEST n), in this case BY TOP 10. If you need to summarize the NET_SALES value from multiple detail records, then this may require two passes.
Here's a sample from the CAR file:
-* FIRST CREATE SUMMARIZED DATA TABLE FILE CAR SUM SEATS BY COUNTRY BY CAR ON TABLE HOLD END -* NOW SORT SUMMARIZED DATA BY TOP RESULTS TABLE FILE HOLD PRINT CAR SEATS BY COUNTRY BY HIGHEST 2 SEATS NOPRINT END
For yours it would be:
TABLE FILE BLAH SUM NET_SALES BY DIVISION BY CUSTOMER ON TABLE HOLD END
TABLE FILE HOLD PRINT CUSTOMER NET_SALES BY DIVISION BY TOP 10 NET_SALES NOPRINT END
Hope that helps.
-Chris
p.s. - Edited to fix coding sample.
Posts: 55 | Location: New York | Registered: March 07, 2003
use the LIST verb instead of PRINT and it will put a line number in the first position. HOLD the result then PRINT * IF LIST FROM 10 TO 20 or whatever. "LIST" refers to variable E01
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
(FOC006) THE FORMAT OF THE TEST VALUE IS INCONSISTENT WITH FIELD FORMAT: 5;
TABLE FILE CAR SUM SALES BY HIGHEST TOTAL SALES NOPRINT BY CAR ON TABLE HOLD END -*TYPE &RECORDS; -SET &MIDDLE = &RECORDS /2 ; -*TYPE &MIDDLE; TABLE FILE HOLD LIST CAR SALES
ON TABLE HOLD AS HOLD01
END TABLE FILE HOLD01 PRINT LIST CAR SALES IF LIST EQ 5; END
I have a report where I need to show Top 10 Customers based on sales. I implemented that by Ranking by Highest 10.
Now I need to display 1)The top 10 customers' sales totals 2)The remaining customers' sales totals and 3)The total customers (top 10 + remaining customers) sales totals
For e.g if I have 50 customers in total, I need display totals for top 10, remaining 40 and total(i.e. 50) customers sales.
TABLE FILE TEST SUM
CURRENTSALES/D12C AS 'Sales' CURRENTBP/D12C AS 'BP'
RANKED AS 'RANK' BY TOTAL HIGHEST 10 CURRENTSALES NOPRINT BY NAME AS 'Customer' ON TABLE COLUMN-TOTAL AS 'TOTAL' END
Any ideas ?
Thanks.
Test - Webfocus 7.6.7 Prod - Webfocus 7.6.7 Win2003 Sql Server 2000 and 2008
I would like to use amper variables for column totals. I have to calculate Total GP% based on the Total Sales and cost. So others might not work for this case.
Do you have a sample code for this type of report.
Thank you, KK
Test - Webfocus 7.6.7 Prod - Webfocus 7.6.7 Win2003 Sql Server 2000 and 2008
I do not understnad why you want to use amper variables for column totals. Unfortunately I do not have a 7.6 install to give you a working example. I was only posting information that I knew of. I would assume that you can apply all normal COMPUTE, SUBTOTALS, RECOMPUTEs etc. to a request using PLUS OTHER and get the results you want.
Thanks!
Mickey
FOCUS/WebFOCUS 1990 - 2011
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003
I apologize, what I mentioned earlier is not intended for this topic.
When I add others its adding subfoot for every sort break. This is not what I want, I want remaining 40 customers sales total. And its giving me invalid characters like @. I am not sure what is wrong.
Thank you.
Test - Webfocus 7.6.7 Prod - Webfocus 7.6.7 Win2003 Sql Server 2000 and 2008
create a dummy sort field for the top 10 to be 1 value and all others to be a different dummy sort value - thus effectively splitting them into distinct groups. this should help.
Thank you all for your suggestions. I had a deadline so didn't get a chance to research on that and had to make the changes in the sql server stored procedure to return the desired results.
Frank, I will definitely try your approach.This message has been edited. Last edited by: KK,
Test - Webfocus 7.6.7 Prod - Webfocus 7.6.7 Win2003 Sql Server 2000 and 2008
Adding on to some old posts. I am creating a top 10 with a line totalling all others. I found Frank's approach worked great, but I am wondering if the same output is possible without a Hold File.
I have tinkered with the PLUS OTHER functionality from the GUI but so far I have not been successful.