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     [CLOSED] Grand Total Percentage

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Grand Total Percentage
 Login/Join
 
Master
posted
I posted some code a week or so ago. I was reporting BadDebt, Charges and a Percentage of the two trended across by month and subtotalling by Dept. The Percentage subtotals for each month were additive, not 'recomputed'. The forum helped me add the RECOMPUTE VERB and all was fine.

Now I added GRAND TOTALS. The final set of columns (totals for all months- bad Debt, Charges, %) is now summing the percentages again instead of 'recomputing' them on the Dept subtotal and for the final grand total row.

I assume I need another: RECOMPUTE...somewhere...


THANKS for your HELP!!!

TABLE FILE HOLDMERGE
SUM
HOLDMERGE.HOLDMERG.BADDEBT/P20C AS 'Bad Debt'
HOLDMERGE.HOLDMERG.CHGS/D12 AS 'Charges'
COMPUTE PERCENTAGE/D12.2% = ( HOLDMERGE.HOLDMERG.BADDEBT / HOLDMERGE.HOLDMERG.CHGS ) * 100; AS 'Percentage'
BY LOWEST J0.TBLMSTR_BANBRBANAMEXREF.IDXSPECIALTY
BY LOWEST J0.TBLMSTR_BANBRBANAMEXREF.RPTBANBR
BY J0.TBLMSTR_BANBRBANAMEXREF.RPTBANAME
ACROSS LOWEST HOLDMERGE.HOLDMERG.FY
ACROSS LOWEST HOLDMERGE.HOLDMERG.PERIOD AS 'Period'

ON J0.TBLMSTR_BANBRBANAMEXREF.IDXSPECIALTY RECOMPUTE
SUM. 'HOLDMERGE.HOLDMERG.BADDEBT'
SUM. 'HOLDMERGE.HOLDMERG.CHGS'
PERCENTAGE AS '*TOTAL'
WHERE ( HOLDMERGE.HOLDMERG.FY EQ &FY.Enter 4 Digit Fiscal year. ) AND ( J0.TBLMSTR_BANBRBANAMEXREF.IDXSPECIALTY EQ &IDXSPECIALTY.(OR(FIND TBLMSTR_BANBRBANAMEXREF.TBLMSTR_BANBRBANAMEXREF.IDXSPECIALTY,TBLMSTR_BANBRBANAMEXREF.TBLMSTR_BANBRBANAMEXREF.IDXSPECIALTY IN tblmstr_banbrbanamexref)).Select the desired Specialty/s. );
WHERE HOLDMERGE.HOLDMERG.PERIOD LE &PERIOD.Enter the Ending Period in the format: YYYYMM, Ex: thru July 2014: 201407.;
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET BYDISPLAY ON
ON TABLE ROW-TOTAL AS 'TOTAL'
ON TABLE COLUMN-TOTAL AS 'TOTAL'
ON TABLE PCHOLD FORMAT EXL2K

dept subtotal % was summing. Some forum help pointed me to the RECOMPUTE verb and all was then fine.

Now I added Grand Totals. The grand total works fine by month but the Grand Total for ALL months is now additive and I am not sure how to 'recompute' it.

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 8206.08
Windows, All Outputs
 
Posts: 603 | Registered: June 28, 2013Report This Post
Virtuoso
posted Hide Post
Instead of
ON TABLE COLUMN-TOTAL
use
ON TABLE SUMMARIZE


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

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Master
posted Hide Post
Tried the above...see code below...it had no effect.

To be specific, I get my months going across segmented into BadDebt / Charges / % under each month.

The report subtotals at DEPT. This all works fine EXCEPT for the LAST 3 columns of the report Total BadDebt / Charges/ %....on the Dept subtotal and on the last row (grand total), the percentages are added, not calculated. Again, entire report is fine except the subtotal lines for the LAST 3 columns as well as theGRAND total for the last 3 columns.

ON TABLE HOLD AS HOLDMERGE FORMAT ALPHA
MORE
FILE HOLDCHGS
END

JOIN
LEFT_OUTER HOLDMERGE.HOLDMERG.BANBR IN HOLDMERGE TO UNIQUE
TBLMSTR_BANBRBANAMEXREF.TBLMSTR_BANBRBANAMEXREF.IDXBANBR
IN TBLMSTR_BANBRBANAMEXREF TAG J0 AS J0
END
TABLE FILE HOLDMERGE
SUM
HOLDMERGE.HOLDMERG.BADDEBT/P20C AS 'Bad Debt'
HOLDMERGE.HOLDMERG.CHGS/D12 AS 'Charges'
COMPUTE PERCENTAGE/D12.2% = ( HOLDMERGE.HOLDMERG.BADDEBT / HOLDMERGE.HOLDMERG.CHGS ) * 100; AS 'Percentage'
BY LOWEST J0.TBLMSTR_BANBRBANAMEXREF.IDXSPECIALTY
BY LOWEST J0.TBLMSTR_BANBRBANAMEXREF.RPTBANBR
BY J0.TBLMSTR_BANBRBANAMEXREF.RPTBANAME
ACROSS LOWEST HOLDMERGE.HOLDMERG.FY
ACROSS LOWEST HOLDMERGE.HOLDMERG.PERIOD AS 'Period'

ON J0.TBLMSTR_BANBRBANAMEXREF.IDXSPECIALTY RECOMPUTE
SUM. 'HOLDMERGE.HOLDMERG.BADDEBT'
SUM. 'HOLDMERGE.HOLDMERG.CHGS'
PERCENTAGE AS '*TOTAL'
WHERE ( HOLDMERGE.HOLDMERG.FY EQ &FY.Enter 4 Digit Fiscal year. ) AND ( J0.TBLMSTR_BANBRBANAMEXREF.IDXSPECIALTY EQ &IDXSPECIALTY.(OR(FIND TBLMSTR_BANBRBANAMEXREF.TBLMSTR_BANBRBANAMEXREF.IDXSPECIALTY,TBLMSTR_BANBRBANAMEXREF.TBLMSTR_BANBRBANAMEXREF.IDXSPECIALTY IN tblmstr_banbrbanamexref)).Select the desired Specialty/s. );
WHERE HOLDMERGE.HOLDMERG.PERIOD LE &PERIOD.Enter the Ending Period in the format: YYYYMM, Ex: thru July 2014: 201407.;
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET BYDISPLAY ON
ON TABLE ROW-TOTAL AS 'TOTAL'
-*ON TABLE COLUMN-TOTAL AS 'TOTAL'
ON TABLE SUMMARIZE AS 'TOTAL'
ON TABLE PCHOLD FORMAT EXL2K


WebFOCUS 8206.08
Windows, All Outputs
 
Posts: 603 | Registered: June 28, 2013Report This Post
Master
posted Hide Post
Ok, I tried commenting out the ON TABLE ROW-TOTAL AS TOTAL line. Now it works.

Can some explain what is going on? Its not clear to me why or what the SUMMARIZE is doing and why I need to comment out the ON TABLE ROW / ON TABLE COLUMN statements.

Can you set this RECOMPUTE / SUMMARIZE via the GUI or must you always update the text?


WebFOCUS 8206.08
Windows, All Outputs
 
Posts: 603 | Registered: June 28, 2013Report This Post
Master
posted Hide Post
Ahhhhh!

No, its not working. As my cubemate just pointed out...the total columns for the rows are now gone!

I need those!


WebFOCUS 8206.08
Windows, All Outputs
 
Posts: 603 | Registered: June 28, 2013Report This Post
Virtuoso
posted Hide Post
To fix your subtotals, either do not mix SUM. and normal results, or set the option that allows you to mix those (I forgot which, but it has to be set to NEW or something).

Frankly though, you don't need to specify SUM. there, the RECOMPUTE will take care of that because those columns aren't COMPUTE results. The only way to recompute them is to SUM them.

For the grand-total, I'm fairly certain that you can also specify ON TABLE RECOMPUTE just like you did for the subtotal RECOMPUTEs.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Master
posted Hide Post
When I turn on Grand totals (across and down), it is the subtotals and grand totals that appear in the newly added last 3 columns that are causing teh grief.

The ON TOTAL RECOMPUTE sounds good but no luck so far.

To get me thru, I came up with this...seems to work....but I have not had success in moving the totals to the end right...seems they need to be to the left or they repeat for each month. Tehre must be a simpler way...there is a verb or something I am undoubtable missing...there must be other folks with a report trended by month with a few totals and a percentage...who need grand totals for all months...

TABLE FILE HOLDMERGE
SUM
HOLDMERGE.HOLDMERG.BADDEBT/P20C AS 'Total Bad Debt'
HOLDMERGE.HOLDMERG.CHGS/D12 AS 'Total Charges'
COMPUTE PERCENTAGE/D12.2% = ( HOLDMERGE.HOLDMERG.BADDEBT / HOLDMERGE.HOLDMERG.CHGS ) * 100; AS 'Total Percentage'
BY LOWEST J0.TBLMSTR_BANBRBANAMEXREF.IDXSPECIALTY
BY LOWEST J0.TBLMSTR_BANBRBANAMEXREF.RPTBANBR
BY J0.TBLMSTR_BANBRBANAMEXREF.RPTBANAME
ON J0.TBLMSTR_BANBRBANAMEXREF.IDXSPECIALTY RECOMPUTE
SUM. 'HOLDMERGE.HOLDMERG.BADDEBT'
SUM. 'HOLDMERGE.HOLDMERG.CHGS'
PERCENTAGE AS '*TOTAL'
SUM
HOLDMERGE.HOLDMERG.BADDEBT/P20C AS 'Bad Debt'
HOLDMERGE.HOLDMERG.CHGS/D12 AS 'Charges'
COMPUTE PERCENTAGE/D12.2% = ( HOLDMERGE.HOLDMERG.BADDEBT / HOLDMERGE.HOLDMERG.CHGS ) * 100; AS 'Percentage'
BY LOWEST J0.TBLMSTR_BANBRBANAMEXREF.IDXSPECIALTY
BY LOWEST J0.TBLMSTR_BANBRBANAMEXREF.RPTBANBR
BY J0.TBLMSTR_BANBRBANAMEXREF.RPTBANAME
ACROSS LOWEST HOLDMERGE.HOLDMERG.FY
ACROSS LOWEST HOLDMERGE.HOLDMERG.PERIOD AS 'Period'


ON J0.TBLMSTR_BANBRBANAMEXREF.IDXSPECIALTY RECOMPUTE
SUM. 'HOLDMERGE.HOLDMERG.BADDEBT'
SUM. 'HOLDMERGE.HOLDMERG.CHGS'
PERCENTAGE AS '*TOTAL'
WHERE ( HOLDMERGE.HOLDMERG.FY EQ &FY.Enter 4 Digit Fiscal year. ) AND ( J0.TBLMSTR_BANBRBANAMEXREF.IDXSPECIALTY EQ &IDXSPECIALTY.(OR(FIND TBLMSTR_BANBRBANAMEXREF.TBLMSTR_BANBRBANAMEXREF.IDXSPECIALTY,TBLMSTR_BANBRBANAMEXREF.TBLMSTR_BANBRBANAMEXREF.IDXSPECIALTY IN tblmstr_banbrbanamexref)).Select the desired Specialty/s. );
WHERE HOLDMERGE.HOLDMERG.PERIOD LE &PERIOD.Enter the Ending Period in the format: YYYYMM, Ex: thru July 2014: 201407.;
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET BYDISPLAY ON
-*ON TABLE ROW-TOTAL AS 'TOTAL'
-*ON TABLE COLUMN-TOTAL AS 'TOTAL'
ON TABLE SUMMARIZE
ON TABLE PCHOLD FORMAT EXL2K
ON TABLE SET HTMLCSS ON


WebFOCUS 8206.08
Windows, All Outputs
 
Posts: 603 | Registered: June 28, 2013Report This Post
Virtuoso
posted Hide Post
Robert,

Here is a solution to your problem:
  
TABLE FILE CAR
SUM 
RCOST NOPRINT DCOST NOPRINT 
BY COUNTRY
SUM 
RCOST DCOST COMPUTE RATIO/D7.2=RCOST / DCOST;
BY COUNTRY
ACROSS SEATS COMPUTE TRCOST/D6=C1; TDCOST/D6=C2; TRATIO/D7.2=TRCOST / TDCOST;
ON TABLE SUMMARIZE
END


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

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Virtuoso
posted Hide Post
quote:
Originally posted by RobertF:
The ON TOTAL RECOMPUTE sounds good but no luck so far.


TABLE, not TOTAL.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Master
posted Hide Post
****CLOSED

thanks..I had no luck with the last two offerings...leaving my code as is...we have some folks going to training soon...I'll send this as an example to get some assistance with...


WebFOCUS 8206.08
Windows, All Outputs
 
Posts: 603 | Registered: June 28, 2013Report 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     [CLOSED] Grand Total Percentage

Copyright © 1996-2020 Information Builders