You are on page 1of 2

Step 2: Create a calculation measure with If statement to calculate the running

total

1.2.3 Imported/Live Hana model: Add calculation⇒Running total


you have an imported model
or you have a Live Hana model
you used a DATE type dimension as the time dimension to calculate cross-time
accumulative sum
or you used a NON-DATE dimension to calculate cross-time accumulative
sum/average/count, etc
Since 2023.01, we introduced a new type of function called “running total”. This
calculation allows you to create a running total of SUM, COUNT, MIN/MAX, and
AVERAGE. However, please note, no matter using a Date dimension or a non-date
dimension, the cross-time calculation WILL NOT restart from a new year. The running
total purely depends on the dimension used in the calculation and the data shown in
the table.

.2.4 Live Hana model with enriched time dimensions: Add calculation
you have a Hana Live model
you enrich the string-based time dimensions or date dimensions in your HANA view
when creating the live model
If you enrich the string-based time dimensions or date dimensions in your HANA
view, you can use time-related features to calculate YOY, PY, and YTD. Please read
the help on how to maintain time dimensions:

1.2.5 Imported, Live BW, Live Hana model: Add calculation from a column
you have an import model
or BW Live model
or HANA LIVE model
you used a date dimension or non-date dimension to calculate the accumulated sum
In this case, you can use “add calculation” from your target measure column to
achieve multiple types of accumulative calculation. However, please note, no matter
if you use a Date dimension or non-date dimension, the cross-time calculation WILL
NOT restart from a new year.

1.2.6 BW Live Model: a bit challenging


you have a BW Live model
you want to calculate the cross-time accumulative sum
Unfortunately, time-related calculations are not supported for BW live models from
the story. We recommend creating the calculation in BW directly and using SAC to
consume it. Read more:

1.2 Create a Cumulative Sum from a calculation or table


The most convenient way to add cross-time cumulative calculations is to use the
“Add Calculation” function associated with the measure. However, depending on the
type of model you use, there are some limitations.
1.2.1 Imported model: Add calculation⇒Restricted account, Difference from
you have an imported model
you used a DATE type dimension as the time dimension to calculate the cross-time
accumulative sum
In this case, simply click the three dots of the account and use add a calculation
to add YOY, YTD, and PY calculations.

1.2.2 Imported model: Resultlookup function


you have an imported model
you want to first aggregate a measure across a dimension (eg, get all quality sold
per quarter across three years), then calculate running totals.
In case, we will use the calculated measure in the “add calculation” feature to
complete a series of calculations to achieve it. Some manual work is needed. We
will take this “3-year total quality sold per quarter and running total” as an
example.

Step 1: first we need to sum up all quality sold per quarter for three years. We
first created a calculated dimension based on the Date dimension:

Then use “RESULTLOOKUP” function to calculate the summation for each quarter:

https://blogs.sap.com/2020/06/11/analyse-your-data-live-with-sap-

You might also like