I have a dataframe with values as below-
Amount Product DocDate
0 1099.0 1100 2018-01-02
1 1234.0 1100 2018-01-04
2 1000.0 1100 2018-01-06
3 8000.0 1100 2018-01-28
4 3000.0 1100 2018-02-09
5 4500.0 1100 2018-02-20
I need to calculate the sum of amount field calculated on end of each fortnight.
Example:
Product Amount FortNight
1100 3333.0 Jan 1st Fortnight (this could be date format too!!)
1100 3000.0 Feb 2nd Fortnight
1100 4500.0 Feb 1st Fortnight
It would be great if it did not involve loops( since I have loops for product too) I tried separating (grouping) both week and month and calculating, but couldn't get expected results since its a column in dataframe.
Thanks in advance. Appreciate help.