MOVINGAVG
Category: Rollforward & time series
Overview
Description | Returns the moving average over the last WindowSize elements including the current one. If there are not enough elements with values, Use when you need a rolling average over a defined time window. |
|---|---|
Syntax |
|
Parameters |
|
Examples
Two-period moving average by quarter
This example shows a two-period moving average across quarterly values. The result starts once enough values are available to fill the window.
Input node: Profit
Quarter | Profit |
|---|---|
2025-Q1 | 30 |
2025-Q2 | 120 |
2025-Q3 | 210 |
2025-Q4 | 300 |
Formula: MOVINGAVG('Profit', "Quarter", 2)
Quarter | → MOVINGAVG Result |
|---|---|
2025-Q2 | 75 → (30+120)/2 |
2025-Q3 | 165 → (120+210)/2 |
2025-Q4 | 255 → (210+300)/2 |