Calculation of a ratio
Dear Community,
I would like to supplement the presentation of a profit and loss statement with a ratio.
This should always show the percentage of the upper node. This means, for example, the percentage share of sales in total output or the share of personnel costs in total costs.
As the ratio is to be calculated and displayed dynamically down to the account level, I need a dynamic calculation.
Can anyone help me with this?
Thank you very much!
9 replies
-
Hi Jona, I think what you are looking for is a context calculation. It is covered in the following section of the help. https://help.pyramidanalytics.com/Content/Root/MainClient/apps/Discover/PRO/Calculations/contextCalcs/Context%20Calculations.htm?Highlight=context%20calculations
Right click on column heading of the column to calculate the percentage ratio. Then select "query options' -> 'quick calc' -> 'create measure' -> 'cumulative measure' -> 'percentage of total'. This will create a new column.
In the drop zones right click on the new column and change the calculation logic to 'by Parent' to get the child items to show the percentage of the parent.
-
Jona, on a second review I might have misunderstood your question. The explanation is in English but the P&L table is German. Before I take another guess would you be able to more clearly state the ratio calculation you would like to achieve. With reference to the columns, rows and amounts. Thanks!
-
its quick and easy if you know how.............
It sounds like you simply want to divide a measure value for the current account by the value of its parent account.
Graphical Method
Start a new Formula in Formulate. Select the data model.
- Add a data point element block and select the measure (maybe "PL" above)
- Go to and select the accounts hierarchy (see below in my example). Click the small Fx button on the top right.
- Now click on "current member"
- Add a divide operator to your formula, and add another data point block as above. Reselect the same measure.
- Select the account hierarchy again. This time, instead of current member, choose parent.
And its done!
Script Method
Instead of all the clicking, change to script mode and simply build out the following formula with your specifics:
([Measures].[Accounting Amount],[Account].[Account].CurrentMember)/ ([Measures].[Accounting Amount],[Account].[Account].Parent)
-
thank you very much. The calculation now works.
Is it also possible to exclude certain elements from the hierarchy from the calculation?
For example, the key figure makes no sense for “Gesamtleistung” (Total operating revenue), “Gesamtkosten” (Total costs), “EBITDA”, “Abschreibung” (Depreciation and amortization), “Finanzergebnis” (Financial result), “Neutrales Ergebnis” (Non-operating result), “Steuern” (Taxes) and “Ergebnis vor Ergebnisverwendung" (Profit before appropriation of profit).These elements should therefore be hidden. However, it could become complicated as the elements come from different levels of the hierarchy.
Many thanks in advance!