Focal Point
[CLOSED] How do I suppress a single subtotal?

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

September 17, 2012, 03:41 PM
Swamp
[CLOSED] How do I suppress a single subtotal?
When I have subtotals for 2, 4, and 5 seats I get three set of subtotals, which is what I want. When I have a subtotal for 5 seats I get one set of subtotals. I do not want this because the subtotal is the same as the total. It appears it is from the Department of Redundancy Department! Can I suppress the subtotal when there is only one subtotal?

Try this with and without the WHERE statement:
TABLE FILE CAR
PRINT CAR MODEL SEATS
BY SEATS NOPRINT
ON SEATS SUBTOTAL AS 'Total'
-*WHERE SEATS EQ 5
END

This message has been edited. Last edited by: Kerry,


WebFOCUS 7.6.10
Windows
Excel, PDF, HTML
September 17, 2012, 04:15 PM
David Briars
Have you looked at the MULTILINES parameter, of the SUBTOTAL command?




Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster
September 17, 2012, 04:21 PM
Swamp
David,


MULTILINES will suppress the SUBTOTAL when there is only one detail line. I have multiple detail lines but one subtotal line. You can see this by adding a second where of:
WHERE CAR EQ 'JAGUAR'


WebFOCUS 7.6.10
Windows
Excel, PDF, HTML
September 18, 2012, 02:09 AM
atturhari
Do you want the last subtotal line (Grandtotal) to be supressed?


WF 7.7.02 on Windows 7
Teradata
HTML,PDF,EXCEL,AHTML
September 18, 2012, 03:09 AM
GamP
If you want the subtotals and the grandtotal to show in case there are more than 1 by values, the SUBTOTAL command works fine. If you want only the one subtotal line when there is just 1 by value, you would also need the ON TABLE NOTOTAL command. These two are mutually exclusive, when used in the same request.
You could try to follow a different approach, the one of the intermediate hold file:
TABLE FILE CAR
PRINT CAR MODEL SEATS
BY SEATS NOPRINT
WHERE SEATS EQ 5
ON TABLE HOLD AS REP_DATA
END

TABLE FILE REP_DATA
COUNT DST.SEATS
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS SEATS FORMAT ALPHA
END
-RUN
-READ SEATS &SEATS.5.
-SET &TOTAL = IF &SEATS EQ 1 THEN 'TABLE' ELSE 'SEATS';

TABLE FILE REP_DATA
PRINT CAR MODEL SEATS
BY SEATS NOPRINT
ON &TOTAL SUBTOTAL AS 'Total'
END



GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988