cancel
Showing results for 
Search instead for 
Did you mean: 

How do we calculate the user-defined average in data action in SAC ?

varunc6
Explorer
0 Kudos

Hello,

The situation is as follows.

In the data action, I want to define a computation that, given user input, computes the average for the preceding three months. Kindly review the screenshot that's below.

Here, variable "n" is user input. So, if the user inputs n=3, then the logic should give the average of the last 3 months. If the month is July (forecast), then the average of April, May, and June (actual) should be calculated. If the month is August, then the average of May (actual), June (actual), and July (forecast) should be calculated.

Anyone who has faced a similar kind of issue or knows the workaround in this case. Their comments would be deeply appreciated.

Thanks

View Entire Topic
N1kh1l
Active Contributor
0 Kudos

varunc66

The below should give you some idea

https://answers.sap.com/questions/13969332/sac-data-action-advanced-formula-calculate-average.html?c...

To get data across versions ( Actuals and Forecast both) is the trick which you should think about. But as Actual periods would not have any forecast data and vice versa, you can just read both versions for last 3 periods for average calculations.

Br.

Nikhil

varunc6
Explorer
0 Kudos

Thanks Nikhil. it helps.