Focal Point
SOLUTION: Using SUBTOTAL and RECOMPUTE with ACROSS in same report

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/2197093006

March 16, 2011, 01:56 PM
BobV
SOLUTION: Using SUBTOTAL and RECOMPUTE with ACROSS in same report
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
March 22, 2011, 11:51 AM
Kerry
Thank you Bob for sharing the solution with all, good job!! Smiler

Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.