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.
TABLE FILE CAR SUM RCOST COMPUTE RUN_TOT=LAST RUN_TOT + RCOST; BY COUNTRY END
gets you
COUNTRY RETAIL_COST RUN_TOT ENGLAND 45,319 45,319.00 FRANCE 5,610 50,929.00 ITALY 51,065 101,994.00 JAPAN 6,478 108,472.00 W GERMANY 64,732 173,204.00
Regards,
Darin
In FOCUS since 1991 WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex WF Client: 77 on Linux w/Tomcat
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007
Thanks a lot for the ideas that you shared. I missed to mention one thing in one of the colums we use the PCT prefix to cumpute for the percentage. here are the actual codes that i have.
TABLE FILE MBF9REP SUM 'AVE.MBDDREP.MBDDREP.AvePrice' AS 'Average, Price' 'MBDDREP.MBDDREP.DDARQT' AS 'Overall, Sales, (Units)' 'MBDDREP.MBDDREP.DDDUVA' AS 'Consumption, Value($)' 'PCT.MBDDREP.MBDDREP.DDDUVA' AS 'Consumption,Value(%)' COMPUTE CNSPCT/D12.2 = LAST CNSPCT + PCT.MBDDREP.MBDDREP.DDDUVA; RANKED AS 'RANK' BY TOTAL HIGHEST 'MBDDREP.MBDDREP.DDDUVA' NOPRINT BY 'MBDDREP.MBDDREP.DDAITX'
when i run the report its not showing the correct figure to be displayed in the CNSPCT column.
Your code is technically correct. The problem here is that you are trying to do two things in one pass of the data which are interferring with each other. The BY TOTAL HIGHEST sort is done last AFTER COMPUTEs. Therefore your running total is being calculated before the final sort which then rearranges the order. You need to create a HOLD file first with the aggregated values and then do another TABLE FILE using the HOLD file to get your final results.
Here's a working example with the CAR database.
TABLE FILE CAR SUM AVE.RCOST AS 'AVERCOST' SALES WEIGHT PCT.SALES AS 'PCTSALES' BY COUNTRY ON TABLE HOLD AS STEPONE ON TABLE SET ASNAMES ON END -RUN TABLE FILE STEPONE PRINT AVERCOST SALES WEIGHT PCTSALES COMPUTE RUNTOT/D12.2=LAST RUNTOT + PCTSALES; RANKED AS 'RANK' BY HIGHEST SALES BY COUNTRY END
Thanks!
Mickey
FOCUS/WebFOCUS 1990 - 2011
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003