Former Member

# How to implement moving average key figure?

Dear colleagues:

I have a counter key figure to display the number of purchase items delivered on time on a monthly basis (the month of 0DSDEL_DATE).

However, I need to calculate a moving average from the 3 months before each Characteristic Value on 0DSDEL_DATE.

By doing this, the bar diagram will be able to show the on time delivered items and also a line diagram showing the 3 monthly moving average.

The question is:

<b>What is the best procedure to calculate such moving average key figure? </b>

Best regards

Waldemar

##### Add a comment
10|10000 characters needed characters exceeded

### Related questions

Posted on Aug 13, 2005 at 09:30 AM

Hi Waldemar,

I’m not sure if it will work with counters. Just try.

Create a variable type 0CALMONTH for a single user entry. - For entering the reporting month.

Create a structure in columns, put there your counter, restrict it by your VAR.

Create a new selection MON-3, put there your counter, restrict it by your VAR with offset = -3, make it hidden.

Create a new selection MON-2, put there your counter, restrict it by your VAR with offset = -2, make it hidden.

Create a new selection MON-1, put there your counter, restrict it by your VAR with offset = -1, make it hidden.

Create a new formula. It should calculate (MON-3 + MON-2 + MON-1)/3.

Restriction of month by a variable will force to pop up window for var value entry.

I hope that properly understood your requirements:

To have one column for a KF for the reporting month and another column – for calculating average of the three previous months.

Best regards,

Eugene

##### Add a comment
10|10000 characters needed characters exceeded
• Eugene Khusainov Former Member

Hi Jenn,

It's easy. For example, you have a characteristic in a query that you want restrict by a variable with offset.

Right click on this char - Restrict, click on a 'Variables' tab and choose a variable by transferring it to the right panel. Then right click on this var - Specify Variable Offset. Put into 'Offset' field value you need.

Best regards,

Eugene