Focal Point
Prefix operators with ROW-TOTAL

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

July 05, 2006, 04:21 PM
Sara
Prefix operators with ROW-TOTAL
Does anyone know if there's a way I can apply a prefix operator (specifically 'AVE', i.e. average) to a specific component of a ROW-TOTAL?

I have a BY field and an ACROSS field, the ACROSS spans two COMPUTE fields, one COMPUTE field sums values while the other simply displays a predetermined value (value stored in the database is an number which is an average) therefore the first component of the ROW-TOTAL needs to be sum while the other needs to be an average.


WebFocus Reporting 7.1.1 Windows
July 28, 2006, 05:06 PM
Noreen Redden
there is a new feature coming out that will do SUMMARIZATIONs on ACROSS fields, but it isn't ready right now. Also, it would have to be tweaked to do your AVE anyway. So, here is what I recommend.
Let's say you had the code
TABLE FILE CAR
SUM COMPUTE TOTAL = RCOST + DCOST;
COMPUTE NUMBER = SALES;
BY COUNTRY
BY CAR
ACROSS BODYTYPE
END
To get out the totals the easiest way, USE sortgroup in the PAINTER, to make your code look like:
TABLE FILE CAR
=* c1 c2
SUM RCOST NOPRINT DCOST NOPRINT
-* C3
COMPUTE COL1 = RCOST + DCOST; NOPRINT
-* C4
COMPUTE COL2 = AVE.SALES; NOPRINT
BY COUNTRY
BY CAR
SUM COMPUTE TOTAL = RCOST + DCOST;
NUMBER = SALES;

BY COUNTRY BY CAR
ACROSS BODYTYPE
COMPUTE TOTAL1 = C3; AS 'TOTAL'
TOTAL2 = C4;
END

That should give you what you want.
You might look at:
http://techsupport.informationbuilders.com/sps/20442045.html and
http://techsupport.informationbuilders.com/sps/20262069.html

on the techsupport web site.


WEFOCUS - All releases starting at 4.3.6
MF FOCUS -- All releases starting at 3.8.68
OS/Platfor _ Predominately Z/OS, but all others as swell
Expected Output Format -- *
August 14, 2006, 03:06 PM
Sara
Great, thanks for the information! The need to satisfy this requirement has diminished however if it returns I will certainly try this and report back with what I find. Thanks again!


WebFocus Reporting 7.1.1 Windows