Focal Point
Calculation using Column Totals

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

December 16, 2011, 03:23 PM
GCohen
Calculation using Column Totals
I would like to use the column totals in an ACROSS report to compute a new value, and then to display this value beneath the Column Total at the end of the report.


Release 7.6.9
Windows
HTML
December 16, 2011, 03:36 PM
j.gross
Try a multiverb request. Need I say more?
December 16, 2011, 04:29 PM
GCohen
But, I need the individual across values, e.g. C1, C2, etc not just the overall total.


Release 7.6.9
Windows
HTML
December 16, 2011, 05:26 PM
FrankDutch
mcguyver maybe?

Next year you should visit the summit
There is a wonderfull presentation that shows you all smart solution in one hour.
Worth all the time, but register in time, places are all used.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

December 18, 2011, 05:27 PM
j.gross
define file ...
tvalue/... = value ;
end

table file ...
write tvalue noprint
across colkey
write value
across colkey
by rowkey
...
end

should give you n col total variables and n col detail variables which you can reference in COMPUTE or RECAP.
December 20, 2011, 07:28 AM
Danny-SRL
quote:
I would like to use the column totals in an ACROSS report to compute a new value


What type of compute is on your mind? Is it a function of the number of columns only or also of the values of the ACROSS sort field?

For example:
I sum SALES BY COUNTRY ACROSS SEATS.
The new value is the sum of the column-total for all seats with an even number.
  
-* File gcohen01.fex
SET HOLDLIST=PRINTONLY
TABLE FILE CAR
SUM SALES BY SEATS 
ON TABLE SAVE
END
-RUN
-SET &S=&LINES;
-SET &T=0;
-SET &SP='<+0> ';
-REPEAT #COMP FOR &I FROM 1 TO &S;
-READ SAVE &SEAT.A3. &SALES.A6.
-TYPE &SEAT &SALES
-SET &T = &T + IMOD(&SEAT + 1, 2, 'I2') * &SALES;
-SET &SP=&SP | '<+0> ';
-#COMP
-RUN
-SET &SP=&SP | '<FST.T'
DEFINE FILE CAR
T/I6=&T;
END
TABLE FILE CAR
SUM 
     SALES
ACROSS  SEATS
BY  LOWEST COUNTRY
ON TABLE SET PAGE-NUM NOLEAD 
ON TABLE ROW-TOTAL AS 'TOTAL'
ON TABLE COLUMN-TOTAL AS 'TOTAL'
ON TABLE SUBFOOT
"&SP"
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = endeflt,
$
TYPE=ACROSSVALUE,
     ACROSS=1,
     BACKCOLOR='WHITE',
$
TYPE=ACROSSVALUE,
     COLUMN=ROWTOTAL(1),
     BACKCOLOR='WHITE',
$
TYPE=TABFOOTING, HEADALIGN=BODY, 
$
ENDSTYLE
END

This message has been edited. Last edited by: Danny-SRL,


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

December 23, 2011, 11:07 AM
Kerry
Thanks for everyone's input.

GCohen, we have a McGyver Dynamic Subtotals/SubFoots technique under the tips and techniques section, which may be of help: http://www.informationbuilders...opers/McGyverDynamic

Happy holidays to everyone!! Smiler

Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.