I got a dataframe which look like this :
date_order date_despatch date_validation qty_ordered
2019-01-01 00:00:00 2019-11-01 00:00:00 2019-13-01 00:00:00 4.15
2019-01-01 00:00:00 2019-12-01 00:00:00 2019-14-01 00:00:00 5.9
2019-02-01 00:00:00 2019-16-01 00:00:00 2019-19-01 00:00:00 7.8
2019-03-01 00:00:00 2019-18-01 00:00:00 2019-20-01 00:00:00 9.6
2019-04-01 00:00:00 2019-22-01 00:00:00 2019-24-01 00:00:00 1.3
...
2019-03-02 00:00:00 2019-22-02 00:00:00 2019-25-02 00:00:00 1.2
My goal is to get, for each month, a cumulative sum of the quantity ordered from the start of the month to the last friday of this same month (e.g : 2019-01-01 to 2019-25-01 for January 2019)
What would be expected :
date_order cumulative_ordered
2019-01-01 00:00:00 10.05
2019-02-01 00:00:00 17.85
... ...
2019-24-01 00:00:00 150
2019-25-01 00:00:00 157
Can anyone help me on this?