Skip to main content

groupArrayMovingAvg

Introduced in: v20.1.0 Calculates the moving average of input values.
The function uses rounding towards zero. It truncates the decimal places insignificant for the resulting data type.
Syntax
Parameters
  • window_size — Size of the calculation window. If left unspecified, the function takes the window size equal to the number of rows in the column. UInt64
Arguments
  • numbers_for_summing — Expression resulting in a numeric data type value. (U)Int* or Float* or Decimal
Returned value Returns an array of the same size as the input data. For non-Decimal input, the array contains Float64 values. For Decimal input, the array contains Decimal values with the input scale. Array Examples Usage example
Query
Response
With window size
Query
Response