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     [SOLVED] MY TOTAL IS NOT WORKING AS DESIRED

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] MY TOTAL IS NOT WORKING AS DESIRED
 Login/Join
 
Master
posted
My report has a grand total line. For the most part it works EXCEPT there is a define that does division: column A / column C, the value in the grand total is not doing the math based on the grand total column A / grand total column C.

How do I fix this?

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8206.08
Windows, All Outputs
 
Posts: 603 | Registered: June 28, 2013Report This Post
Virtuoso
posted Hide Post
Please show us your syntax. Are you seeing wacky numbers or is it a rounding problem? What's the format of the DEFINEd field and the two columns?


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Master
posted Hide Post
Here is the define; it works fine on every detail line. I simply clicked the grand totals icon to get totals...I checked, instead of doing the division on the grand total line, it is simply addng all the percenatges.

PCTVARWRVU/D12.2=(HOLDACTBNCHFTEFINAL.SEG01.ANNWRVUS - HOLDACTBNCHFTEFINAL.SEG01.BNCHMARKWRVUFTE) / HOLDACTBNCHFTEFINAL.SEG01.BNCHMARKWRVUFTE * 100;


WebFOCUS 8206.08
Windows, All Outputs
 
Posts: 603 | Registered: June 28, 2013Report This Post
Virtuoso
posted Hide Post
You need to use ON TABLE RECOMPUTE

https://webfocusinfocenter.inf...ang/source/tot75.htm

This message has been edited. Last edited by: BabakNYC,


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Virtuoso
posted Hide Post
RECOMPUTE may not be enough

You may also need to use COMPUTE.
RECOMPUTE is applied to a COMPUTEd field not a DEFINEd field. A DEFINEd field will only be summarized (total).

See below sample's result
DEFINE FILE CAR
DEF_RET /P10.2 = (RETAIL_COST - DEALER_COST) / DEALER_COST * 100;
END
TABLE FILE CAR
SUM RETAIL_COST
    DEALER_COST
    DEF_RET
    COMPUTE CMP_RET /P10.2 = (RETAIL_COST - DEALER_COST) / DEALER_COST * 100;
BY COUNTRY
ON COUNTRY RECOMPUTE AS 'SUB-TOTAL'
BY CAR
ON TABLE RECOMPUTE AS 'GRAND-TOTAL'
END


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Master
posted Hide Post
Ok, still just adding everything up. Perhaps you can clarify. The link BabaNYC provided seems to indicate the Recompute on the grand total will ONLY work if there is one at the subtotal level. Well first, I do not want a subtotal...just detail and a grand total. Nevertheless I added one...but my Grand Total is still adding everything.

I added this:
COMPUTE PCTVARWRVUSUB/D12.2=(HOLDACTBNCHFTEFINAL.SEG01.ANNWRVUS - HOLDACTBNCHFTEFINAL.SEG01.BNCHMARKWRVUFTE) / HOLDACTBNCHFTEFINAL.SEG01.BNCHMARKWRVUFTE * 100;

I added this as my lowest sort (it essentially produces a row similar to the detail):
ON HOLDACTBNCHFTEFINAL.SEG01.BENCHMARKVISITS RECOMPUTE AS 'SUB-TOTAL'

I added this:
ON TABLE RECOMPUTE COLUMN-TOTAL AS 'TOTAL'

I am still doing something wrong.

My code now looks similar to the CAR example except my subtotal would be after the BY CAR level...and I really would not want to print it; ie

BY CAR
ON CAR RECOMPUTE AS 'SUB TTL'
HEADING "My Report Title"
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET BYDISPLAY ON
ON TABLE RECOMPUTE COLUMN-TOTAL AS 'TOTAL'

ON TABLE RECOMPUTE AS 'GRAND TTL'


WebFOCUS 8206.08
Windows, All Outputs
 
Posts: 603 | Registered: June 28, 2013Report This Post
Virtuoso
posted Hide Post
Get rid of COLUMN-TOTAL in the bottom of the page.

  
TABLE FILE CAR
SUM DEALER_COST
RETAIL_COST
COMPUTE PROFIT/D12.2%=(RETAIL_COST - DEALER_COST ) *100 / DEALER_COST ;
BY COUNTRY
BY CAR
BY MODEL
ON TABLE PCHOLD FORMAT HTML
ON TABLE RECOMPUTE AS 'TOTAL'
END

-RUN



WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Master
posted Hide Post
I think I have it working ---thanks!


WebFOCUS 8206.08
Windows, All Outputs
 
Posts: 603 | Registered: June 28, 2013Report This Post
Virtuoso
posted Hide Post
Good. By the way a subtotal isn't required for this to work. The main thing to remember is that calculations like Averages, Percents et cetera, apply to the answer set not each individual record because depending on how many sort fields you have the values will change. Consequently, like MartinY said, you should use a COMPUTE instead of a DEFINE and use RECOMPUTE for subtotals and grand totals. That way the calculations adjust depending on the number of sorts you add to your report instead of just adding a bunch of numbers in a column.


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report 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     [SOLVED] MY TOTAL IS NOT WORKING AS DESIRED

Copyright © 1996-2020 Information Builders