v.19.11New Feature
Aggregate Functions Grouparraymovingsum(win_size)(x) and Grouparraymovingavg(win_size)(x), Which Calculate Moving Sum/avg with or Without Window-size Limitation
Aggregate functionsgroupArrayMovingSum(win_size)(x)andgroupArrayMovingAvg(win_size)(x), which calculate moving sum/avg with or without window-size limitation. #5595 (inv2004)
Why it matters
These functions address the need to efficiently calculate moving sums and averages on grouped array data within ClickHouse, supporting time-series analysis and other scenarios where sliding window computations over grouped data arrays are required.How to use it
Use the functions within your SQL queries by specifying the window size and the target array column, for example:SELECT groupArrayMovingSum(3)(x), groupArrayMovingAvg(5)(x) FROM table GROUP BY keywhere
win_size determines the size of the moving window.