[SOLVED] how to get the average for one column and average for other...
Hi all, i am working on a matrix report,need to know how to get the total for one column and average for another column in the report output. assume that my report output has only two columns..This message has been edited. Last edited by: Kerry,
WebFOCUS Version 7.6.7 windows PDF
July 15, 2009, 02:33 PM
GinnyJakes
Here is a simple answer that may meet your needs:
ON TABLE SUBTOTAL SUM. COL1 AVE. COL2
Note that there is a space between the dot and the column name.
Search for "Manipulating Summary Values with Prefix Operators" in the WF language manual.
I'm not sure if this is close to what you need, a matrix or FML report. I'm not sure how to get the average so I'm summing the four rows and dividing by 4.
I hope this helps.
TABLE FILE CAR
SUM
WIDTH
HEIGHT
BY COUNTRY
FOR SEATS
2 AS '2 SEATER' LABEL R2 OVER
3 AS '3 SEATER' LABEL R3 OVER
4 AS '4 SEATER' LABEL R4 OVER
5 AS '5 SEATER' LABEL R5 OVER
RECAP RTOT(1) = R2(1) + R3(1) + R4(1) + R5(1); AS 'RECAP' OVER
RECAP RTOT(2) = (R2(2) + R3(2) + R4(2) + R5(2)) / 4; AS 'RECAP'
END
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