Focal Point
MULTIPLE SUBTOTALS

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

January 13, 2006, 04:52 PM
Bethany
MULTIPLE SUBTOTALS
How can I create multiple subtotals one of them being conditional?

TABLE FILE OUTPUT
SUM
AMOUNT
BY TERM
BY TERM_TYPE
ON TERM SUBTOTAL
END

So the output looks like:

TERM TERM_TYPE AMOUNT
T1 A 1000
A 500
B 2000
SUBTOTAL T1 3500

T2 A 2500
B 5000
SUBTOTAL T2 7500

TOTAL 11000

The 2nd subtotal I want to add is a subtotal by term where TERM_TYPE NE 'B', so that in the above example the grand total of this 2nd subtotal category would be 4000.


Server Environment: Win2K3 Server WebFOCUS 7.13 Apache Tomcat standalone application server
January 13, 2006, 05:16 PM
ptp
Could be a job for FML.

Good luick,
Paul.
January 14, 2006, 02:59 PM
susannah
it is a good fml app, i agree with paul.
but you can 'cheat'
define a new variable that equals your amount if and only if termtype is A.
bring this variable into your output matrix with a noprint
then subtotal it, as well.
MYFIELD/D8M MISSING ON=IF TERM_TYPE IS 'A' THEN AMOUNT ELSE MISSING;
...
BY TERM BY MYFIELD NOPRINT BY TERM_TYPE
ON TERM SUBTOTAL
ON MYFIELD SUBTOTAL
..this may not be the exact order or whatever that you want, but you can get the idea.
Any help?




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
January 16, 2006, 11:30 AM
Kamesh
If you want specific order, instead of using SubTotal you can use Subfoot.

MYFIELD/D8M MISSING ON=IF TERM_TYPE IS 'A' THEN AMOUNT ELSE MISSING;
...
BY TERM BY MYFIELD NOPRINT BY TERM_TYPE

ON TERM
SUBFOOT
"TERM T1 SUBFOOT
" TERM T2 WHEN TERM_TYPE NE 'B'

Hope this helps.


WFConsultant

WF 8105M on Win7/Tomcat
January 16, 2006, 11:32 AM
Kamesh
earlier post didn't have the full code.

MYFIELD/D8M MISSING ON=IF TERM_TYPE IS 'A' THEN AMOUNT ELSE MISSING;
...
BY TERM BY MYFIELD NOPRINT BY TERM_TYPE

ON TERM
SUBFOOT
"TERM T1 < TOT.AMOUNT"
SUBFOOT
" TERM T2 < MYFIELD "
WHEN TERM_TYPE NE 'B'


WFConsultant

WF 8105M on Win7/Tomcat
January 20, 2006, 03:55 PM
Bethany
Thank you all for the suggestions. I had multiple columns being summed so I ended up creating a new calculated column which got to the end result. I will however try these options in the future.

Thanks Again!


Server Environment: Win2K3 Server WebFOCUS 7.13 Apache Tomcat standalone application server