Snippet for calculating moving avg using sql/biguqery

Calculate moving avg using sql/biguqery

AVG(users) OVER (ORDER BY day ROWS BETWEEN 6 PRECEDING AND 0 FOLLOWING) AS moving_avg


What about moving average for different categories? For example, we have date, categories, fee. We would like to calculate the moving avg for each category.

Published: by ;