Focal Point
[SOLVED]How to get subtotal for few columns only and not for other columns

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

February 19, 2015, 05:47 AM
info4pal
[SOLVED]How to get subtotal for few columns only and not for other columns
Hi,

Iam using the below piece of code and Iam doing a subtotal on the COL3 and Iam getting the subtotal for MON_RESULTS till COL_DOLLAR but I need the Subtotal only from MON_RESULTS till Total column.

Can anyone please let me know how to not show the subtotal for these 2 columns namely - COL_PERCENT and COL_DOLLAR.

TABLE FILE SQLOUT
PRINT
COL1
COL2
COL3
COL4
MON_RESULTS
TUE_RESULTS
WED_RESULTS
THUR_RESULTS
FRI_RESULTS
SAT_RESULTS
TOTAL
COL_PERCENT
COL_DOLLAR
COL9_text
BY COL3 NOPRINT
ON TABLE PCHOLD FORMAT EXL2K
ON COL3 SUBTOTAL
END
-RUN
-EXIT

Thanks a lot in advance!

Regards!

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


Webfocus 8105 Developer studio,Windows 7,HTML,Excel,PDF,Text,Infoassist,Graph,AHTML
February 19, 2015, 06:44 AM
Ram Prasad E
Check below code.

If you are looking for documentation, please check below link for more details.
http://infocenter.informationb...s.com/wf80/index.jsp


APP PATH IBISAMP
TABLE FILE CAR
SUM
SALES
DEALER_COST
COMPUTE PCT_DEALER_COST/D20.2%=PCT.DEALER_COST;
RETAIL_COST
BY COUNTRY
ON COUNTRY SUBTOTAL DEALER_COST RETAIL_COST
ON TABLE SET PAGE-NUM NOLEAD
END


Thanks,
Ram


WebFOCUS 8.1.05
Windows
http://ibiwebfocus.wordpress.com
https://www.facebook.com/groups/ibi.webfocus/
February 20, 2015, 09:04 AM
George Patton
As Ram indicates, the default for SUBTOTAL is to subtotal all numeric fields (including percentages, which makes the result ridiculous). To subtotal only specific fields, just identify them after the SUBTOTAL command. Any fields not specifically mentioned will be ignored.


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
February 20, 2015, 09:34 AM
info4pal
Hi,

Thanks Ram for the solution.It helped!

George - Thanks a lot for the explanation as well!It was helpful.

Regards,
IP


Webfocus 8105 Developer studio,Windows 7,HTML,Excel,PDF,Text,Infoassist,Graph,AHTML