Focal Point
subtotal on secondary or tertiary sort field summarized at bottom of report

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

July 12, 2013, 02:19 PM
BobV
subtotal on secondary or tertiary sort field summarized at bottom of report
Long subject, I know.
Wondering if there are any McGyvers out there that may be able to help.
I would like to subtotal on a 3rd BY field but then have the subtotal for all those values at the bottom of the report.
TABLE FILE A
SUM
CNT.CUST_ID
BY CAMP
BY COMM
BY CHNL
END

I would like to subtotal BY CHNL after the SUM BY's

thanks

BobV


WF (App Studio) 8.2.01m / Windows
Mainframe FOCUS 8
July 15, 2013, 10:03 AM
Doug
You preprocess your "final report request" using your final "3rd sort field" as your primary sort and HOLD that to a file which you will JOIN to in your final report request where you'll PRINT/SUM the totals in the HOLD file in a footing where it's needed.
July 15, 2013, 11:42 AM
Danny-SRL
Bob,
You were right: it is a job for McGuyver:
  
-SET &ECHO=ALL;
-* File BobV01.fex
-*
SET NODATA = ' '
-*
JOIN BLANK WITH BODYTYPE IN CAR TO BLANK IN FSEQ AS B_
-*
DEFINE FILE CAR
BLANK/A1 WITH BODYTYPE=' ';
XCOUNTRY/A10=IF COUNTER EQ 2 THEN ' ' ELSE COUNTRY;
XCAR/A16=IF COUNTER EQ 2 THEN ' ' ELSE CAR;
END 
-*
TABLE FILE CAR
SUM SALES
BY COUNTER NOPRINT
BY XCOUNTRY AS COUNTRY
BY XCAR AS CAR
BY SEATS
ON XCOUNTRY SUBFOOT
" "
WHEN COUNTER EQ 1
ON XCOUNTRY SUBHEAD
"Recap by Seats"
WHEN COUNTER EQ 2
ON XCOUNTRY SUBTOTAL MULTILINES AS 'Total ' 

WHERE COUNTER LE 2

ON TABLE NOTOTAL
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
include=endeflt,
$
-*
ENDSTYLE
END



Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF