Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Using two Subtotals to calculate a ratio

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Using two Subtotals to calculate a ratio
 Login/Join
 
Gold member
posted
I am getting a brain cramp trying to tackle this problem:

I have a report that has three subtotals based on three different part types:

Type 1 Part1 $111
Part2 $111
Part3 $111
Subtotal 1 $333
Type 2 Part1 $111
Part2 $111
Subtotal 2 $222
Type 3 Part1 $111
Subtotal 3 $111

I need to do a ratio calculation of Subtotal 2/Subtotal 1 as long as Subtotal 1 is greater than 0.

The user actually wants this ratio as part of the Subtotal 2 line which is another animal in itself.

Any ideas how I can tackle this problem or restructure my report to handle this?

Any help is appreciated!

Thanks,
Tim
 
Posts: 57 | Registered: February 24, 2004Report This Post
Expert
posted Hide Post
ouch...a brain cramp...You probably want to look up the RECAP command and the ST. prefix. That ought to do it for you.
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Guru
posted Hide Post
You can also do this using SUBFOOT.
Here is what I think your trying to do:
DEFINE FILE CAR<br />TYPE_NUM/A6 = DECODE COUNTRY('ENGLAND' 'TYPE 1' 'FRANCE' 'TYPE 2' 'ITALY' 'TYPE 3');<br />END<br />-RUN<br />-*<br />TABLE FILE CAR<br />SUM<br />RETAIL_COST<br />COMPUTE RATIO/D10.7S = 0;<br />COMPUTE ORD/A1 = '1';<br />BY TYPE_NUM<br />BY CAR<br />WHERE COUNTRY IN ('ENGLAND','FRANCE','ITALY')<br />ON TABLE HOLD AS H0 FORMAT ALPHA<br />END<br />-RUN<br />-*<br />TABLE FILE H0<br />SUM<br />COMPUTE CAR/A16 = '';<br />RETAIL_COST<br />COMPUTE RATIO/D10.7S = IF TYPE_NUM EQ 'TYPE 2' THEN RETAIL_COST / (LAST RETAIL_COST) ELSE 0;<br />COMPUTE ORD/A1 = '2';<br />BY TYPE_NUM<br />ON TABLE HOLD AS H1 FORMAT ALPHA<br />END<br />-RUN<br />-*<br />TABLE FILE H0<br />PRINT<br />RETAIL_COST<br />RATIO<br />BY TYPE_NUM<br />BY ORD NOPRINT<br />BY CAR<br />MORE<br />FILE H1<br />END<br />-RUN
 
Posts: 406 | Location: Canada | Registered: May 31, 2004Report This Post
Virtuoso
posted Hide Post
I may have the ratio calculations backwards to what you want, but this is a method to have different subfoots. Works for two levels anyway.

SET STYLEMODE = FIXED
TABLE FILE CASHFLOW
SUM SHRT_TERM_DEBT NOPRINT
SHRT_TERM_EQUIT NOPRINT
BY QTR
SUM SHRT_TERM_DEBT
SHRT_TERM_EQUIT
BY QTR
BY MONTH
WHERE QTR EQ 'Q1 1998' OR 'Q2 1998'
ON QTR RECAP
RATIOA/D7.3 = ( LAST C1 / C1 ) * 100;
RATIOB/D7.3 = ( LAST C2 / C2 ) * 100;
ON QTR SUBFOOT
" <20> <ST.SHRT_TERM_DEBT <ST.SHRT_TERM_EQUIT "
WHEN QTR EQ 'Q1 1998'
SUBFOOT
" <20> <ST.SHRT_TERM_DEBT <ST.SHRT_TERM_EQUIT <RATIOA <RATIOB "
WHEN QTR EQ 'Q2 1998'
END
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Gold member
posted Hide Post
Susannah, reFOCUSing and Leah:

Thanks a bunch! I tried the examples and looked at the RECAP command (which I didn't think was this versatile), and I can definitely use any one of these to accomplish what I need to do.

You are all lifesavers!.....and I am in desparate need of a vacation.
 
Posts: 57 | Registered: February 24, 2004Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Using two Subtotals to calculate a ratio

Copyright © 1996-2020 Information Builders