groupArrayMovingAvg
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.
- — 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.
Example
CREATE TABLE t
(
`int` UInt8,
`dec` Decimal32(2)
)
ENGINE = TinyLog
The queries:
SELECT
groupArrayMovingAvg(int) AS I,
FROM t
SELECT
groupArrayMovingAvg(2)(int) AS I,
groupArrayMovingAvg(2)(float) AS F,
FROM t