9

Volume Hierarchy Percentage Calculation using SAP Analytics Cloud for Planning

 1 year ago
source link: https://blogs.sap.com/2022/11/28/volume-hierarchy-percentage-calculation-using-sap-analytics-cloud-for-planning/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
November 28, 2022 2 minute read

Volume Hierarchy Percentage Calculation using SAP Analytics Cloud for Planning

Hello,

this is Filippo, I’m SAP Planning Solution Architect and I worked with both BPC and SAC.

In this blog, I would like to show a basic data action: how to calculate the Volume measure percentage under all Hierarchy levels in a Product dimension inside SAP Analytics Cloud.

Let’s start with the model:

Capture-24.jpg

The Model has 5 input measures:

Capture-26.jpg

Volume is the measure that is going to be used to store the quantity.

H1PAGG, H1PPERC, H2PAGG, and H2PPERC are the measures to be used to store the aggregations and the percentages.

In this model, we have Product and Business Unit, with an Account dimension that contains a Volume Account.

The Product has the below structure:

Capture-25.jpg

As you can see, under every total there is a _TOT member. This member will be used to calculate and store the total for that level.

Let’s build now a simple input story and create some volumes for all the products:

Capture-27.jpg

As you can see, the volumes are rolling up on the BAG and BOX members, and from there to the TOT member.

Now let’s calculate the _TOT MEMBERS and store them under the H1PAGG and H2PAGG measures.

We will perform this calculation with a data action: since it is not currently possible to read from hierarchy members in data action, we will need to create two properties in the product dimension, H1P and H2P.

These two properties will tag the total members to be calculated, which will mimic the two levels of the H1 Hierarchy:

Capture-29.jpg

Once the properties are in SAC, we can write an advanced formula script to calculate the two hierarchy levels’ aggregate volume and the percentage of each volume under the respective parent:

Capture-31.jpg

Finally, we can embed a trigger in our input Story and run it.

Capture-33.jpg

As you can see, the script calculated the H1PAGG and H2PAGG measures: they are aggregations according to the hierarchies.

After this calculation, the script calculates the H1PPERC and H2PPERC, which are the percentages of the volume under the first and second levels of the hierarchy.

For validation purposes, we can see that the combination of H1PAGG and HP2AGG is matching with Volume at TOT Level (Volume = 145).

H2PPERC is representing the percentage of each product volume compared to the total, that is 1.

H1PPERC is representing the percentage of each product volume compared to the second-level hierarchies. Since we have two intermediate levels of aggregation, the total is 2.

Thank you so much for reading this blog, please ask any questions in the comment if you need further detail on this SAC data action calculation, and feel free to share feedback.

If you liked this blog, follow me at Filippo Naggi

Stay tuned for interesting SAP Analytics Cloud out-of-the-box deep dive blogs.

Filippo


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK