MOVINGSUM function

  • 14 January 2022
  • 0 replies
  • 1194 views

Userlevel 1

Description

 

Computes the sum of numbers within a fixed-size window moving along a Dimension List. For each item from given Dimension List, the sum is computed from all defined numbers within the considered window, blank values are ignored.

By default, if the input Block is defined over a Time Dimension, the moving sum is applied over this Dimension.

 

Syntax

MOVINGSUM(Input, Window Size [, End Offset] [, Dimension])
  • Input Block is the data source on which moving sum is computed, and must be an expression of Integer or Decimal type. 
  • Window Size is the size of the moving window (number of items considered). Must be above or equal to 1. 
  • End Offset is the offset of the last item within the window relative to current one. This argument defaults to zero, meaning the window includes all items from Window Size - 1 to current one. Default: 0.
  • Dimension is the Dimension List along which the window is moving. This argument defaults to the Time Dimension of input if there is exactly one, and must be explicitly specified otherwise. Default: a Time Dimension on which Input Block is defined (Day, Month, Quarter or Year).

 

Return type

Same as input data source, either Integer or Decimal.

 

Example

Metric Data Employee x Month defined on 2 Dimensions (Month and Employee)

 

Click on the image to make it larger

 

 

 

 

See also

 


This topic has been closed for comments