Skip to main content
Skip table of contents

MOVINGAVG

Basic Overview

Description

Returns the moving average over the last WindowSize elements including the current one. If there are not enough elements with values null is returned.

Syntax

MOVINGAVG(Node, TimeLevel, WindowSize)

Parameters

  • Node: Input node, specified using the node name in single quotes (e.g. 'Profit')

  • TimeLevel: Name of the time level that forms the time series to average (e.g. "Month")

  • WindowSize: Number of elements (including the current one) to average (e.g. 3)

Example

Input Profit

Quarter

Profit

2019-Q1

30

2019-Q2

120

2019-Q3

210

2019-Q4

300


Output MOVINGAVG('Profit',"Quarter",2)

Year

Profit

2019-Q2

75 → (30+120)/2

2019-Q3

165 → (120+210)/2

2019-Q4

255 → (210+300)/2




JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.