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.
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,
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.
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, 2013
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 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'
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, 2015
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, 2015