MicroStrategy ONE

Moving average

Information returned

Returns the moving average of the current value and preceding values as defined by the WindowSize parameter. The calculations can be restarted base on attributes set in the function parameters. This is an OLAP function.

Syntax

MovingAvg<BreakBy = {}, SortBy = ()>(Argument, WindowSize)

  •  

  • BreakBy is the attribute indicating where the calculation restarts.

  • SortBy is the attribute or metric by which the data is sorted.

  • Argument is a metric representing a list of numbers.

  • WindowSize is a positive integer indicating the number of values to use in each calculation.

For additional information on and an example of this function, refer to the MicroStrategy Functions Reference.