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 , Anaplan architect at MaxPlan and Master Anaplanner. Updated .

What is the syntax of MOVINGSUM?

MOVINGSUM(Line item to aggregate[, Start offset[, End offset[, Aggregation method[, List]]]])

Negative offsets look back, positive offsets look forward, and 0 is the current period. The first argument must be a line item.

MOVINGSUM arguments left out
You leave outClassicPolaris
Both offsetsThe whole time rangeThe whole time range
End offsetOnly the start periodFrom the start period to the end of the timeline
Aggregation methodSUM for numbers, ANY for Booleans, FIRSTNONBLANK for the restSUM for numbers, ANY for Booleans
ListTime, the only choiceTime

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:

MOVINGSUM(Sales.Revenue, -2, 0)

The average of the last three months:

MOVINGSUM(Sales.Revenue, -2, 0, AVERAGE)

The next three months:

MOVINGSUM(Sales.Revenue, 1, 3)
MOVINGSUM results over four months
JanFebMarApr
Revenue10012090110
Sum, -2 to 0100220310320
Average, -2 to 0100110103.3106.7
Sum, 1 to 33202001100

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:

IF Time settings.Month number < 3 THEN 0 ELSE MOVINGSUM(Sales.Revenue, -2, 0, AVERAGE)

MOVINGSUM, TIMESUM, YEARTODATE or CUMULATE?

Which Anaplan time aggregation to use
You needUse
A window that moves with each periodMOVINGSUM
One value for a fixed range, without TimeTIMESUM
A total that restarts each yearYEARTODATE
A total that never restartsPREVIOUS 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.

Check your model