Yes besides generic SQL window queries, I think we should also consider adding sliding/rolling window aggregation functions to do the moving window aggregation over a look back period. From the description of the above issue, it seems like sliding window aggregation might solve the problem
Potential inputs to the function
⢠Column to run rolling window over
⢠Column/expression to compute the aggregate over.
⢠Size of window (3days, 3hours etc) / lookback period
Can also combine with dimension columns in which case the output will contain 1 row per window and unique dimension combination.