MOVINGSUM
Basic Overview
Description | Returns the moving sum over the last WindowSize elements including the current one. If there are not enough elements with values null is returned. |
---|---|
Syntax | MOVINGSUM(Node, TimeLevel, WindowSize) |
Parameters |
|
Example
Input Profit
Quarter | Profit |
---|---|
2019-Q1 | 30 |
2019-Q2 | 120 |
2019-Q3 | 210 |
2019-Q4 | 300 |
Output MOVINGSUM('Profit',"Quarter",2)
Year | Profit |
---|---|
2019-Q2 | 150 → (30+120) |
2019-Q3 | 330 → (120+210) |
2019-Q4 | 510 → (210+300) |