I am trying to count kind of DAU by specified actions, where users are divided into categories by number of their actions within some interval.
Raw data example:
date user_id amount_actions
2018-12-01 1 2
2018-12-02 1 1
2018-12-10 1 1
2018-12-01 2 2
2018-12-02 2 1
2018-12-10 3 1
Result table I wish I could have:
date user_id amount_actions rolling_sum_7_days
2018-12-01 1 2 2
2018-12-02 1 1 3
2018-12-10 1 1 1
2018-12-01 2 2 2
2018-12-12 2 1 1
2018-12-10 3 1 1
2018-12-15 3 1 2
Thanks.