MOVINGSUM in Anaplan
MOVINGSUM aggregates a line item over a window that moves with each period, such as the last three months. Give both offsets: with only the first, Classic returns one period and Polaris runs to the end of the timeline.
By Nikolai Starostin, Anaplan architect at MaxPlan and Master Anaplanner. Updated .
What is the syntax of MOVINGSUM?
Negative offsets look back, positive offsets look forward, and 0 is the current period. The first argument must be a line item.
| You leave out | Classic | Polaris |
|---|---|---|
| Both offsets | The whole time range | The whole time range |
| End offset | Only the start period | From the start period to the end of the timeline |
| Aggregation method | SUM for numbers, ANY for Booleans, FIRSTNONBLANK for the rest | SUM for numbers, ANY for Booleans |
| List | Time, the only choice | Time |
If the start offset is greater than the end offset, Polaris returns the default value: 0, FALSE or blank. In Classic it depends on the method.
MOVINGSUM examples
The last three months:
The average of the last three months:
The next three months:
| Jan | Feb | Mar | Apr | |
|---|---|---|---|---|
| Revenue | 100 | 120 | 90 | 110 |
| Sum, -2 to 0 | 100 | 220 | 310 | 320 |
| Average, -2 to 0 | 100 | 110 | 103.3 | 106.7 |
| Sum, 1 to 3 | 320 | 200 | 110 | 0 |
Why is a rolling average wrong in the first months?
Periods outside the timeline are ignored, so the first windows are shorter. In January the three-month average divides by 1, and in February by 2. If you want nothing until the window is full, test the period first. Month number is 1 in the first month of the timeline, 2 in the second, and so on:
MOVINGSUM, TIMESUM, YEARTODATE or CUMULATE?
| You need | Use |
|---|---|
| A window that moves with each period | MOVINGSUM |
| One value for a fixed range, without Time | TIMESUM |
| A total that restarts each year | YEARTODATE |
| A total that never restarts | PREVIOUS or CUMULATE |
Planual 2.02-21 recommends MOVINGSUM in place of TIMESUM in a line item with Time. Check your own model to find large TIMESUMs that need the change.
Does MOVINGSUM work in Polaris?
Yes, and it can run over a list. FIRSTNONBLANK, LASTNONBLANK and TEXTLIST aren't available there, and the source can't have a coarser time scale than the result.
Sources
Check your model
Upload the line-items blueprint. The basic check runs in your browser and needs no email.