I have a report where i have to calculate for column total, after column total i have a calculate where one CNT_Field is count of row and other filed is sum for column
TABLE FILE CAR PRINT SEATS SALES BY CAR WHERE CAR IN ('AUDI','BMW') ON TABLE COLUMN-TOTAL AS 'TOTAL' SEATS SALES ON TABLE PCHOLD FORMAT HTML END
<u>
CAR SEATS SALES </u>
AUDI 5 7800
BMW 5 8950
4 8900
5 14000
5 18940
5 14000
5 15600
TOTAL 34 88190
34*12 408
GrantTotal 88598
above calculation how to do Grand Total
This message has been edited. Last edited by: Tamra,
WebFOCUS 8202
January 30, 2017, 08:04 AM
MartinY
This could be a way that gives exactly the numbers that you're looking at:
TABLE FILE CAR
SUM COMPUTE T1 /D10 = SEATS; NOPRINT
COMPUTE T2 /D10 = SALES; NOPRINT
COMPUTE T11 /D10 = T1 * 12; AS 'SEATS INCREASED'
COMPUTE TOT /D10 = T11 + T2; AS 'GRAND TOTAL'
BY TOTAL COMPUTE CAR /A10 = '';
PRINT SEATS
SALES
BY CAR
WHERE CAR IN ('AUDI','BMW');
ON TABLE COLUMN-TOTAL AS 'TOTAL' SEATS SALES
ON TABLE PCHOLD FORMAT HTML
END
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007
January 30, 2017, 03:06 PM
Danny-SRL
Or this:
-* File dev05.fex
TABLE FILE CAR
PRINT
SEATS SALES
BY CAR
WHERE CAR IN ('AUDI','BMW')
ON TABLE COLUMN-TOTAL AS 'TOTAL' SEATS SALES
ON TABLE RECAP
PI/I5=SEATS * 12;
GT/I6=SALES + PI;
ON TABLE SUBFOOT
" <+0>PI<PI"
"Grand<+0>Total<GT"
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET STYLE *
TYPE=TABFOOTING,
HEADALIGN=BODY,
JUSTIFY=RIGHT,
$
ENDSTYLE
END
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF