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     Need to divide 2 subtotals? Help.

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Need to divide 2 subtotals? Help.
 Login/Join
 
Silver Member
posted
Maybe it's just me, but this seems to easy to be putting so much time into... I have calculated 2 subtotals in my subfooting, now I need to divide the 2 subtotals to get a percentage. How do I do this? I didn't think RECAP or Compute were what I needed, am I wrong?

Here's my code...
 TABLE FILE VW_12CICS
PRINT 
     PARTICIPANTSYTD
     QUALIFICATIONS
     ACHIEVEDGOALYTD
     defGoalAchievedPCT AS 'Percent,Achieved ,Goal'
     TOTALCOSTSAVINGS
     TOTALCOSTAVOIDANCEYTD
BY CONDITION NOPRINT
BY CLINICALNDICATOR
     
ON CONDITION SUBHEAD
" <CONDITION"
ON CONDITION SUBFOOT
"Subtotal <ST.PARTICIPANTSYTD <ST.ACHIEVEDGOALYTD <ST.TOTALCOSTAVOIDANCEYTD"
HEADING
"<CONDITION"
ON TABLE SET PAGE-NUM OFF 
ON TABLE COLUMN-TOTAL AS 'Total' TOTALCOSTAVOIDANCEYTD
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
     FONT='ARIAL',
     SIZE=8,
     COLOR='BLACK',
     BACKCOLOR='NONE',
     STYLE=NORMAL,
$
TYPE=DATA,
     BORDER-TOP=LIGHT,
     BORDER-BOTTOM=LIGHT,
$
TYPE=TITLE,
     BORDER-TOP=LIGHT,
     BORDER-BOTTOM=LIGHT,
     COLOR='BLACK',
     BACKCOLOR=RGB(205 238 162),
     STYLE=BOLD,
$
TYPE=TITLE,
     COLUMN=N4,
     JUSTIFY=DEFAULT,
$
TYPE=TITLE,
     COLUMN=N5,
     JUSTIFY=DEFAULT,
$
TYPE=SUBHEAD,
     BORDER-TOP=LIGHT,
     BORDER-BOTTOM=LIGHT,
     STYLE=BOLD,
$
TYPE=SUBFOOT,
     BORDER-TOP=LIGHT,
     BORDER-BOTTOM=LIGHT,
     STYLE=BOLD,
$
TYPE=SUBFOOT,
     BY=1,
     BACKCOLOR=RGB(242 251 230),
$
TYPE=SUBFOOT,
     BY=1,
     LINE=1,
     OBJECT=FIELD,
     ITEM=1,
     POSITION='N3',
$
TYPE=SUBFOOT,
     BY=1,
     LINE=1,
     OBJECT=FIELD,
     ITEM=2,
     POSITION='N5',
$
TYPE=SUBFOOT,
     BY=1,
     LINE=1,
     OBJECT=FIELD,
     ITEM=3,
     POSITION='N8',
$
TYPE=GRANDTOTAL,
     BORDER-TOP=LIGHT,
     BORDER-BOTTOM=HEAVY,
     BACKCOLOR=RGB(205 238 162),
     STYLE=BOLD,
$
TYPE=REPORT,
     COLUMN=N4,
     WRAP=2.500000,
$
ENDSTYLE
END
 


Thanks!


WebFOCUS 7.1.4
WIN XP/SP2
 
Posts: 37 | Location: Baltimore, MD, USA | Registered: September 06, 2006Report This Post
Virtuoso
posted Hide Post
quote:
TABLE FILE VW_12CICS
add
SUM PARICIPANTSYTD ACHIEVEDGOALYTD TOTACOSTAVOIDANCEYTD
COMPUTE PCT/D9.4 = (C1 / C2 ) * 100;
BY CONDITION NOPRINT
BY CLINICALNDICATOR
end of add

PRINT
PARTICIPANTSYTD
QUALIFICATIONS
ACHIEVEDGOALYTD
defGoalAchievedPCT AS 'Percent,Achieved ,Goal'
TOTALCOSTSAVINGS
TOTALCOSTAVOIDANCEYTD
BY CONDITION NOPRINT
BY CLINICALNDICATOR

ON CONDITION SUBHEAD
" ON CONDITION SUBFOOT
"Subtotal


Then print the computed field in the subfoot, is one way to do it, don't think focus allows you to use the two subtotals with out doing a recap.


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Virtuoso
posted Hide Post
The following does what you are looking for. However, by default, the RECOMPUTE causes the value of the sort field to be displayed after the AS phrase value.

TABLE FILE CAR
SUM RCOST DCOST
COMPUTE PCOST/F3%=DCOST / RCOST * 100;
BY COUNTRY RECOMPUTE AS 'Subtotal:'
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF,$
ENDSTYLE
END


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
 
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003Report This Post
Silver Member
posted Hide Post
Thanks, but I can't seem to get either one to work. Leah, when tried your method I couldn't get it to do the calculation on the subtotal. It used the last row of data to do the calc. I'm don't completely understand the RECAP command. I don't think I can use it since I'm not doing a Financial Report.

Mickey, this won't work either, simply because of formatting issue with the output.

Do either of you know how to get Leah's example working with the subtotals?

Here's my code with the added calc...
 TABLE FILE VW_12CICS
SUM 
     PARTICIPANTSYTD NOPRINT
     ACHIEVEDGOALYTD NOPRINT
     TOTALCOSTAVOIDANCEYTD NOPRINT
     COMPUTE cmpPCT1/D9% = ( C2 / C1 ) * 100; NOPRINT
BY CONDITION NOPRINT
BY CLINICALNDICATOR 
PRINT 
     PARTICIPANTSYTD
     QUALIFICATIONS
     ACHIEVEDGOALYTD
     defGoalAchievedPCT AS 'Percent,Achieved ,Goal'
     TOTALCOSTSAVINGS
     TOTALCOSTAVOIDANCEYTD
BY CONDITION NOPRINT
BY CLINICALNDICATOR
     
ON CONDITION SUBHEAD
" <CONDITION"
ON CONDITION SUBFOOT
"Subtotal <ST.PARTICIPANTSYTD <ST.ACHIEVEDGOALYTD <cmpPCT1 <ST.TOTALCOSTAVOIDANCEYTD"
ON TABLE SET PAGE-NUM OFF 
ON TABLE COLUMN-TOTAL AS 'Total' TOTALCOSTAVOIDANCEYTD
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
     FONT='ARIAL',
     SIZE=8,
     COLOR='BLACK',
     BACKCOLOR='NONE',
     STYLE=NORMAL,
$
TYPE=DATA,
     BORDER-TOP=LIGHT,
     BORDER-BOTTOM=LIGHT,
$
TYPE=TITLE,
     BORDER-TOP=LIGHT,
     BORDER-BOTTOM=LIGHT,
     COLOR='BLACK',
     BACKCOLOR=RGB(205 238 162),
     STYLE=BOLD,
$
TYPE=TITLE,
     COLUMN=N4,
     JUSTIFY=DEFAULT,
$
TYPE=TITLE,
     COLUMN=N5,
     JUSTIFY=DEFAULT,
$
TYPE=SUBHEAD,
     BORDER-TOP=LIGHT,
     BORDER-BOTTOM=LIGHT,
     STYLE=BOLD,
$
TYPE=SUBFOOT,
     BORDER-TOP=LIGHT,
     BORDER-BOTTOM=LIGHT,
     STYLE=BOLD,
$
TYPE=SUBFOOT,
     BY=1,
     BACKCOLOR=RGB(242 251 230),
$
TYPE=SUBFOOT,
     BY=1,
     LINE=1,
     OBJECT=TEXT,
     ITEM=1,
     STYLE=NORMAL,
$
TYPE=SUBFOOT,
     BY=1,
     LINE=1,
     OBJECT=TEXT,
     ITEM=2,
     STYLE=NORMAL,
$
TYPE=SUBFOOT,
     BY=1,
     LINE=1,
     OBJECT=FIELD,
     ITEM=1,
     STYLE=NORMAL,
     POSITION='N7',
$
TYPE=SUBFOOT,
     BY=1,
     LINE=1,
     OBJECT=FIELD,
     ITEM=2,
     STYLE=NORMAL,
     POSITION='N9',
$
TYPE=SUBFOOT,
     BY=1,
     LINE=1,
     OBJECT=FIELD,
     ITEM=3,
     POSITION='N10',
$
TYPE=SUBFOOT,
     BY=1,
     LINE=1,
     OBJECT=FIELD,
     ITEM=4,
     POSITION='N12',
$
TYPE=GRANDTOTAL,
     BORDER-TOP=LIGHT,
     BORDER-BOTTOM=HEAVY,
     BACKCOLOR=RGB(205 238 162),
     STYLE=BOLD,
$
TYPE=REPORT,
     COLUMN=N4,
     WRAP=2.500000,
$
TYPE=REPORT,
     COLUMN=N8,
     WRAP=2.500000,
$
ENDSTYLE
END
 


Thanks!


WebFOCUS 7.1.4
WIN XP/SP2
 
Posts: 37 | Location: Baltimore, MD, USA | Registered: September 06, 2006Report This Post
Virtuoso
posted Hide Post
What I put in assumed you had a subtotal based on the BY statements. Looking at it I think I put one to many BY statements.
SUM
PARTICIPANTSYTD NOPRINT
ACHIEVEDGOALYTD NOPRINT
TOTALCOSTAVOIDANCEYTD NOPRINT
COMPUTE cmpPCT1/D9% = ( C2 / C1 ) * 100; NOPRINT
BY CONDITION NOPRINT
-*********BY CLINICALNDICATOR probably shouldn't be there. Sorry.


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Silver Member
posted Hide Post
PERFECT! I looked at that and thought that it didn't need to be there... But I didn't remove it. After trying several other things I got no where and decided to ask for more help.

Thank you so much!

Wow, WebFocus is a humbling software...


Thanks!


WebFOCUS 7.1.4
WIN XP/SP2
 
Posts: 37 | Location: Baltimore, MD, USA | Registered: September 06, 2006Report 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     Need to divide 2 subtotals? Help.

Copyright © 1996-2020 Information Builders