Combination of window function with datetime:
Is there is something like this in Snowflake?:
select t.*,
sum(qty) over (partition by article
order by date
range between interval '27 day' preceding and current row
) as sum_qty_28_days
from t;
taken from: