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 code will generate the TotalExpense and TotalIncome rows, but I am having a problem generating the Percent row. I need Percent to equal TotalExpense / TotalIncome
My code... TABLE FILE VWINCOMEEXPENSE SUM VWINCOMEEXPENSE.VWINCOMEEXPENSE.WEEK1 VWINCOMEEXPENSE.VWINCOMEEXPENSE.WEEK2 VWINCOMEEXPENSE.VWINCOMEEXPENSE.WEEK3 VWINCOMEEXPENSE.VWINCOMEEXPENSE.WEEK4 VWINCOMEEXPENSE.VWINCOMEEXPENSE.WEEK5 VWINCOMEEXPENSE.VWINCOMEEXPENSE.MTDTOTAL BY VWINCOMEEXPENSE.VWINCOMEEXPENSE.ACCOUNTTYPE AS '' WHERE VWINCOMEEXPENSE.VWINCOMEEXPENSE.ACCOUNTTYPE EQ 'TotalIncome' OR 'TotalExpense'; ON TABLE SET PAGE-NUM NOLEAD ON TABLE SET ASNAMES ON ON TABLE NOTOTAL ON TABLE PCHOLD FORMAT HTML ON TABLE SET HTMLEMBEDIMG ON ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty, $ ENDSTYLE END
Using the CAR database as an example I would need 'TOTAL' to be 'PERCENT' with the calculation being the 'AUDI' RETAIN_COST divided by the 'BMW' RETAIN_COST. TABLE FILE CAR SUM CAR.BODY.RETAIL_COST BY CAR.COMP.CAR WHERE CAR.COMP.CAR EQ 'AUDI' OR 'BMW'; ON TABLE SET PAGE-NUM NOLEAD ON TABLE SET ASNAMES ON ON TABLE COLUMN-TOTAL AS 'TOTAL' ON TABLE PCHOLD FORMAT HTML ON TABLE SET HTMLEMBEDIMG ON ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * $ ENDSTYLE END
Thanks, DavidThis message has been edited. Last edited by: David M,
WebFOCUS 8.1.05M, 8.2.02M Windows, All Outputs
Posts: 34 | Location: Southern New Jersey | Registered: January 24, 2017
Try calculating each column based on the value of the car first and then use them in your percent calculation. Something like this:
DEFINE FILE CAR
AUDI_RC/D12.2=IF CAR EQ 'AUDI' THEN RCOST ELSE 0;
BMW_RC/D12.2=IF CAR EQ 'BMW' THEN RCOST ELSE 0;
END
TABLE FILE CAR
SUM
COMPUTE PERC/D12.2%=TOT.AUDI_RC/TOT.BMW_RC * 100; NOPRINT
CAR.BODY.RETAIL_COST
BY CAR.COMP.CAR
WHERE CAR.COMP.CAR EQ 'AUDI' OR 'BMW';
ON TABLE FOOTING
"<PERC"
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLEMBEDIMG ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
$
ENDSTYLE
END
WebFOCUS 8206, Unix, Windows
Posts: 1853 | Location: New York City | Registered: December 30, 2015