Focal Point
[SOLVED] Adding an average line after grand totals

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

March 07, 2011, 02:42 PM
JJ
[SOLVED] Adding an average line after grand totals
When I add an average line after grand total, it drops off grand total line. Can someone help me to add average line right below grand total line? I want to have RECOMPUTE by sort break and then grand total and average.

SET SUMMARYLINES=EXPLICIT

TABLE FILE MOVIES
PRINT
COPIES
LISTPR
WHOLESALEPR
COMPUTE AVGPR/F6.2 = LISTPR / COPIES;
DIRECTOR

BY RATING
BY CATEGORY

ON RATING RECOMPUTE
ON TABLE SUMMARIZE AS 'Grand Total'
-*ON TABLE SUBTOTAL
-* AVE. LISTPR
-* AVE. WHOLESALEPR AS 'AVE'
END

Thank you,

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


WebFOCUS 8.2.05
Windows 2003
Excel, HTML, PDF
March 07, 2011, 04:22 PM
<FreSte>
JJ,

Maybe something like this ?

SET SUMMARYLINES=EXPLICIT 

TABLE FILE MOVIES
PRINT
COPIES
LISTPR
WHOLESALEPR
COMPUTE AVGPR/F6.2 = LISTPR / COPIES;
DIRECTOR

BY RATING
BY CATEGORY
WHERE RATING IN ('G','PG13');

ON RATING RECOMPUTE

ON TABLE SUMMARIZE AS 'Grand Total'
ON TABLE RECOMPUTE 
ON TABLE SUBFOOT
"Average<+0> <+0> <AVE.LISTPR  <AVE.WHOLESALEPR <+0>"
ON TABLE SET STYLE *
TYPE=TABFOOTING ,HEADALIGN=BODY ,JUSTIFY=RIGHT ,$
TYPE=TABFOOTING ,HEADALIGN=BODY ,OBJECT=TEXT, JUSTIFY=LEFT ,$
END

March 07, 2011, 05:08 PM
JJ
FreSte,
Thank you for the quick reply. It is the way I wanted to display average but if you look at the two averages(29.98 and 19.99) are not the actual average values. Any ideas?

Thanks again,


WebFOCUS 8.2.05
Windows 2003
Excel, HTML, PDF
March 08, 2011, 03:24 AM
<FreSte>
Then I would suggest you calculate the right values as a computed field and put those in the subfoot

SET SUMMARYLINES=EXPLICIT 

TABLE FILE MOVIES
PRINT
COPIES
LISTPR
WHOLESALEPR
COMPUTE AVGPR/F6.2 = LISTPR / COPIES;
COMPUTE AVG1/D12.2 = TOT.LISTPR/TOT.COPIES; NOPRINT
COMPUTE AVG2/D12.2 = TOT.WHOLESALEPR/TOT.COPIES; NOPRINT
DIRECTOR

BY RATING
BY CATEGORY
WHERE RATING IN ('G','PG13');

ON RATING RECOMPUTE

ON TABLE SUMMARIZE AS 'Grand Total'
ON TABLE RECOMPUTE 
ON TABLE SUBFOOT
"Average<+0> <+0> <AVG1<AVG2  <+0> <+0>"
ON TABLE SET STYLE *
TYPE=TABFOOTING ,HEADALIGN=BODY ,JUSTIFY=RIGHT ,$
TYPE=TABFOOTING ,HEADALIGN=BODY ,OBJECT=TEXT, JUSTIFY=LEFT ,$
END

March 08, 2011, 04:51 PM
JJ
FreSte - Thank you.


WebFOCUS 8.2.05
Windows 2003
Excel, HTML, PDF