Focal Point
How to do further calculation on column totals?

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

September 24, 2007, 06:43 AM
Abhi
How to do further calculation on column totals?
I want to do some calculations on column total values and want to show calculated result values in Subfoot. The report example is:





Monthly Sales
ModelSalesQTY
AAA32500016
BBB54800024
CCC2740008


I am able to print ST.SALES and ST.QTY in subfoot. But how to show further calculation on these totals i.e. Average Sale per Qty = (Total of Sales) / (Total of Qty)

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



WebFOCUS Versions using 7.1; Platform: Windows XP; Output Format: PDF.
September 24, 2007, 09:49 AM
Francis Mariani
Something like this perhaps:

DEFINE FILE CAR
DOLLARS/D10 = RETAIL_COST * SALES;
SALES1/D10 = SALES;
END
-RUN

TABLE FILE CAR
SUM
COMPUTE AVG_SQ/D10 = TOT.DOLLARS / TOT.SALES1; NOPRINT
SALES1
DOLLARS
BY COUNTRY
ON TABLE SUBFOOT
"TOTAL<ST.SALES1<ST.DOLLARS"
"AVE SALES/QTY<AVG_SQ"

ON TABLE SET PAGE NOLEAD
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLESHEET *
FONT='ARIAL', SIZE=8, $
TYPE=TABFOOTING, HEADALIGN=BODY, JUSTIFY=RIGHT, $
TYPE=TABFOOTING, ITEM=1, JUSTIFY=LEFT, $
END
-RUN



Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
September 24, 2007, 12:12 PM
Abhi
Francis,

I appreciate your help with the code example. Now I am able to do lots of other calculations.

Thanks!



WebFOCUS Versions using 7.1; Platform: Windows XP; Output Format: PDF.