Skip to Content
Technical Articles
Author's profile photo Sharon Zhou

SAP Analytics Cloud In-story Calculation Series – Blog4: Calculate the change of order amount between 2019 and 2020

This is the fourth blog of SAP Analytics Cloud In-story Calculation Series. Check out our blog series here to learn more functionalities about In-story Calculation in SAP Analytics Cloud.

Scenario:

Your Warehouse Management Team wants to know the change of order amount between 2019 and 2020 in different cities.

In-story Calculations:

  • Difference From
  • Restricted Measure + Calculated Measure

Method 1: Difference From

In SAP Analytics Cloud, you can use Difference From to reflect the change of a Measure during a certain time frame. In this case, you need to make sure there is at least one Time Dimension in your data.

Method 2: Restricted Measure + Calculated Measure

You might have noticed the Difference From calculation is not always available in SAP Analytics Cloud. If your data connection is based on a live data source, you may find there is no Difference From option in the Calculation Editor. In this case, you can use Restricted Measure and Calculated Measure together to obtain the same result as the Difference From option.

Create Restricted Measure

In this scenario, we need to create 2 Restricted Measures for the order amount in 2019 and 2020 before calculating their difference.

Create Calculated Measure

In this step, we create a Calculated Measure to find the change of order amount between 2019 and 2020:

The following table shows that the results produced by different calculation methods are identical in SAP Analytics Cloud.

Did you find this blog post helpful? Try to enrich your data model with In-story calculation and make your story incredibly more powerful! The next blog will discuss how to use In-story Calculation to calculate Time-to-Delivery. Don’t hesitate to follow this blog series if it’s useful for you!

 

 

* The product interface may vary depending on the product version

Assigned Tags

      4 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Christian Happel
      Christian Happel

      Hi Sharon,

      I don't see the calculation type "Difference From" when creating a new calculated measure.

      What could be the reason for that?

      Here's what I see:

      Thanks, Christian

      Author's profile photo Sharon Zhou
      Sharon Zhou
      Blog Post Author

      Hi Christian,

      The Difference From calculation is not always available in SAP Analytics Cloud. For example, if your data connection is based on live BW, today you may not be able to see the Difference From option. We are continuously working on providing the equivalent calculations between the import data source and live data source. Currently, you can refer to Method 2 of this blog to get your desired result.

      Hope it helps.

      Best,

      Sharon

      Author's profile photo Kumar Natarajan
      Kumar Natarajan

      What about if we have to compare between the current year and previous year, without hard coding the year ?

      Author's profile photo Sharon Zhou
      Sharon Zhou
      Blog Post Author

      Hi Kumar,

      In the "Values or Input Controls" area of "Calculation Editor", you can choose "Current Period" and "Previous Period" to conduct a dynamic comparison.

      BR,

      Sharon