groupArrayMovingAvg
Calculates the moving average of input values.
The function can take the window size as a parameter. If left unspecified, the function takes the window size equal to the number of rows in the column.
Arguments
numbers_for_summing— Expression resulting in a numeric data type value.window_size— Size of the calculation window.
Returned values
- Array of the same size and type as the input data.
The function uses rounding towards zero. It truncates the decimal places insignificant for the resulting data type.
Example
The sample table b:
The queries:
groupArrayMovingAvg
Introduced in: v20.1
Calculates the moving average of input values.
Note
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*orFloat*orDecimal
Returned value
Returns an array of the same size and type as the input data. Array
Examples
Usage example
With window size