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.
Can someone explain me why all the percentage calculations in report painter are good until it takes a negative input value from the data and the percentage result become the difference. At first, it looks like the negative value is recognised as positive. Example: Margin% = sales - costs / sales * 100
Sales = -108.06 Costs = 85.07
If I do the calculation myself, it gives 178.72%. Report painter gives me 21.28% as it took Sales input as a positive value.
What am I missing? Thanks you.This message has been edited. Last edited by: Marikaki,
Marikaki
WF 7.7.03m, MRE, BI Dashboard, DevStudio, Report Caster, Windows 7, I.E. 8/9, Apache Tomcat 6.0, Derby Output formats: Excel2K, PDF, HTML, AHTML
Could you also post the data type and length of all of the fields involved in the calculations? (SALES, COSTS, MARGIN)? There could be something else going on there.
We will need to know what value '&FORMAT' has since it seems to be affecting the data type definition of most columns. Could you also please post your code using the (CODE) tags?
Marikaki, where are you obtaining those values from?
Your field definitions are all D16 (without decimals). Anyway, that may not be that important; what matters is that I simulated your MARGE_PCT calculation using the CAR table and it does provide correct results even when dealing with negative numbers. Adding/removing currency support from the data type definitions did not affect the calculations. Please take a look at FRANCE in the code below:
TABLE FILE CAR
SUM
COMPUTE CURR_EXTPRICE/D16.2M = IF COUNTRY EQ 'FRANCE' THEN -108.06 ELSE SALES; AS 'Sales'
COMPUTE CURR_EXTWAC/D16.2M = IF COUNTRY EQ 'FRANCE' THEN 85.07 ELSE SEATS * 200; AS 'Costs'
COMPUTE MARGE_PCT/D16.2% = (CURR_EXTPRICE - CURR_EXTWAC) / CURR_EXTPRICE * 100; AS 'Margin'
BY COUNTRY
END
Could you replicate a similar exercise with your data hopefully using a single BY field? Something like:
TABLE FILE TMPHOLD
SUM CURR_EXTPRICE
CURR_EXTWAC
COMPUTE COMPUTE MARGE_PCT/D16.2% = (CURR_EXTPRICE - CURR_EXTWAC) / CURR_EXTPRICE * 100;
BY <something>
END
By looking closely at the data that is really being used you might be able to spot what's going on.
Well, I am a little bit because you were right: Looking closely to the data I noticed that when I copied-paste the data to do seperate calculations in Excel, I didn't selected the minus sign of my second value(curr_extwac) which gives a different percentage.
Sorry about that. Have a nice week-end. Merci encore!
Marikaki
WF 7.7.03m, MRE, BI Dashboard, DevStudio, Report Caster, Windows 7, I.E. 8/9, Apache Tomcat 6.0, Derby Output formats: Excel2K, PDF, HTML, AHTML