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

    1. CREATE TABLE t
    2. (
    3. `int` UInt8,
    4. `dec` Decimal32(2)
    5. )
    6. ENGINE = TinyLog

    The queries:

    1. SELECT
    2. groupArrayMovingAvg(int) AS I,
    3. FROM t
    1. SELECT
    2. groupArrayMovingAvg(2)(int) AS I,
    3. groupArrayMovingAvg(2)(float) AS F,
    4. FROM t