Hi all,
I need help with the following:
Attached is the input file and following the the expected output from the table
| ID | Start Date | End Date | Qty | Days |
| 5382673849474000 | 20230202 | 20230315 | 2.2 | |
| 5382673849474000 | 20230315 | 20230323 | 1.3 | |
| 5382673849474000 | 20230323 | 20230315 | 4.5 | |
| 5382673849474000 | 20230315 | 20230316 | 3.5 | |
| 5382673849474000 | 20230316 | 20230317 | 3.68 | |
| 5382673849474000 | 20230317 | 20230328 | 2.4 | |
| 5382673849474000 | 20230328 | 20230331 | 3.7 | |
| 5382673849474000 | 20230331 | 20230503 | 4.6 | |
| 5637839622933700 | 20230131 | 20230306 | 2.3 | |
| 5637839622933700 | 20230306 | 20230307 | 6.7 | |
| 5637839622933700 | 20230307 | 20230309 | 8.9 | |
| 5637839622933700 | 20230309 | 20230310 | 6.7 | |
| 5637839622933700 | 20230310 | 20230313 | 7.8 | |
| 5637839622933700 | 20230313 | 20230314 | 4.7 | |
| 5637839622933700 | 20230314 | | 4.9 | |
If there is no date2 in for ID then use current date or else use the date2 for id
I need to calculate how many days in the days column using start date and end date.
can someone please guide on how I can achieve the result.
Thank you