Please help me to solve this issue, as I am still new to Python/Pyspark. I want to do a loop to do a date sum in multiples of 7 for 13 times in the same column.
I have a master table like this :
id | date |
---|---|
1 | 2019-02-21 10:00:00 |
2 | 2019-02-27 09:50:33 |
etc
I have created a script but wrong, instead created a new column, even though I want to create a new column..
I want this kind of result :
id | x | date |
---|---|---|
1 | 7 | 2019-02-21 |
1 | 14 | 2019-02-28 |
1 | 21 | 2019-03-14 |
1 | 28 | 2019-03-21 |
1 | 35 | 2019-03-28 |
1 | 42 | 2019-04-04 |
1 | 49 | 2019-04-11 |
1 | 56 | 2019-04-18 |
1 | 63 | 2019-04-25 |
1 | 70 | 2019-05-02 |
1 | 77 | 2019-05-09 |
1 | 84 | 2019-05-16 |
1 | 91 | 2019-05-16 |
etc