I would like to find previous four week sales at a level in Python. Say for example
ID Category Date Sales
1 AA 7/02/2022 1
1 AA 31/01/2022 3
1 AA 24/01/2022 5
1 AA 10/01/2022 7
1 AA 03/01/2022 9
2 BB 7/02/2022 2
2 BB 31/01/2022 4
2 BB 24/01/2022 6
2 BB 17/01/2022 8
2 BB 10/01/2022 10
For 1 AA 7/02/2022 sum of last four weeks will be 9 (as 17/01/2022 bales is not there and must include current row date)