Focal Point
[CLOSED] Calculating two fields to get gross percentage.

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/2097016576

April 16, 2015, 05:32 AM
NIrojKumar
[CLOSED] Calculating two fields to get gross percentage.
I have two fields STD_TRK_CNTRB_CM1_AMT and NET_RVNU_AMT.i want to compute a field as “Gross Margin %” .

for e.g value of STD_TRK_CNTRB_CM1_AMT is 1000 and NET_RVNU_AMT is 20. I want to show the value of STD_TRK_CNTRB_CM1_AMT /NET_RVNU_AMT as 20% in the report.

what would be the code?
please advice ASAP.

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


WebFOCUS 8
Windows, All Outputs
April 16, 2015, 07:14 AM
Ramkumar - Webfous
1000 - 20 - 20% ?

What you need to do exactly?


Thanks,

Ramkumar.
WebFOCUS/Tableau
Webfocus 8 / 7.7.02
Unix, Windows
HTML/PDF/EXCEL/AHTML/XML/HTML5
April 16, 2015, 09:30 AM
NIrojKumar
I WANT TO CALCULATE THE PERCENTAGE WHEN BOTH THE VALUE GET DIVIDE.I MEAN 1000/20=50%.


WebFOCUS 8
Windows, All Outputs
April 17, 2015, 07:29 AM
MartinY
I think that what Ramkumar means is that what you are requesting: dividing 1000 by 20 is giving 50 but not 50%.

So, to calculate a gross margin percentage is much more like: (sales_amt - cost_amt) / sales_amt * 100

Or: (1 - ((sales_amt - margin_amt) / sales_amt)) * 100

In your case, if I understand properly your first post:
(1- ((1000 - 20) / 1000)) * 100 = 2%


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