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. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at myibi@ibi.com and provide your corporate email address, company, and name.


Connect to myibi
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     SOLUTION: Using SUBTOTAL and RECOMPUTE with ACROSS in same report

Read-Only Read-Only Topic
Go
Search
Notify
Tools
SOLUTION: Using SUBTOTAL and RECOMPUTE with ACROSS in same report
 Login/Join
 
Gold member
posted
I thought I would post a solution I found on another post within Focal Point.
My goal was to SUBTOTAL one computed field and print fields and RECOMPUTE other computed fields. Here is what I did:
First step to create a higher level total to compute in next step:

SET SUMMARY = EXPLICIT
-*
TABLE FILE LDS
SUM
COMPUTE LEAD_CNTR_TOT/I8=LEAD_CNTR;
BY LEAD_CTL
BY CAMP_DESC
SUM
LEAD_CNTR
CUST_RESP
BY LEAD_CTL
BY CAMP_DESC
BY CONTACT_TYP
ON TABLE HOLD AS SUMM
END
Next step, create the report:
TABLE FILE SUMM
COMPUTE PERCENT_TOT_LEAD/D12.2% = ( LEAD_CNTR / LEAD_CNTR_TOT ) * 100;
LEAD_CNTR/I8C
CUST_RESP/I8C
COMPUTE APP_RATE/D12.2% = ( CUST_RESP / LEAD_CNTR ) * 100;
BY HIGHEST LEAD_CTL NOPRINT
BY CONTACT_TYP
ACROSS CAMP_DESC AS ' ' RECOMPUTE
ACROSS-TOTAL AS 'Grand Totals'
ON LEAD_CTL RECOMPUTE APP_RATE AS 'Totals for'
ON LEAD_CTL SUBTOTAL PERCENT_TOT_LEAD LEAD_CNTR CUST_RESP
ON TABLE PCHOLD FORMAT EXL2K
END

The key here was to total my column PERCENT_TOT_LEAD, yet RECOMPUTE ACROSS. So I could not DEFINE column PERCENT_TOT_LEAD. That would total the column but also total across. The solution is simply this:
SET SUMMARY = EXPLICIT
then
ON sortfield RECOMPUTE FIELD1 (this is to recompute your computes)
ON sortfield SUBTOTAL FIELD2 FIELD3... (this is to total your print fields and total any specific computes)

then use ACROSS ... RECOMPUTE for everything

Here is the original post I found that may be useful.
http://forums.informationbuild...131000441#9131000441

BobV


WF (App Studio) 8.2.01m / Windows
Mainframe FOCUS 8
 
Posts: 93 | Registered: February 20, 2008Report This Post
Expert
posted Hide Post
Thank you Bob for sharing the solution with all, good job!! Smiler

Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.
 
Posts: 1948 | Location: New York | Registered: November 16, 2004Report 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     SOLUTION: Using SUBTOTAL and RECOMPUTE with ACROSS in same report

Copyright © 1996-2020 Information Builders