So i'm stuck on this issue at the moment. Basically i want to structure data into phases, because the descriptions end dates doesn't fully represent when the phase officially ends, the phase ends when the next phase begins.
I've tried to illustrate it here with some test data, left is how it looks, right is how i want it to look. I'm not sure yet because it's a huge dataset, but i'm pretty sure at some stages there might be missing rows and lack of data, in that case i just want it to be filled with "undefined" or similar.
I hope you can help me, it's an sql request in Power Query that i'm working with, and i've tried rearranging the data, this is the closest i could get to what i want.
Note: Phase 6 (last phase) doesn't have to be the description end date, i just typed it in there for now to make the data look better, that's not the part i'm stuck on.
Example data:
Desired result:
I've tried to illustrate it here with some test data, left is how it looks, right is how i want it to look. I'm not sure yet because it's a huge dataset, but i'm pretty sure at some stages there might be missing rows and lack of data, in that case i just want it to be filled with "undefined" or similar.
I hope you can help me, it's an sql request in Power Query that i'm working with, and i've tried rearranging the data, this is the closest i could get to what i want.
Note: Phase 6 (last phase) doesn't have to be the description end date, i just typed it in there for now to make the data look better, that's not the part i'm stuck on.
Example data:
Name | ID | Date Start | Date End | Description |
Name 1 | ID1 | 01-01-2021 | 31-01-2021 | Phase 1 TaskName |
Name 1 | ID1 | 01-02-2021 | 31-01-2021 | Phase 2 TaskName |
Name 1 | ID1 | 01-03-2021 | 31-01-2021 | Phase 3 TaskName |
Name 1 | ID1 | 01-04-2021 | 31-01-2021 | Phase 4 TaskName |
Name 1 | ID1 | 01-05-2021 | 31-01-2021 | Phase 5 TaskName |
Name 1 | ID1 | 01-06-2021 | 30-06-2021 | Phase 6 TaskName |
Name 2 | ID2 | 30-01-2021 | 31-01-2021 | Phase 1 TaskName |
Name 2 | ID2 | 30-05-2021 | 31-01-2021 | Phase 5 TaskName |
Name 2 | ID2 | 30-03-2021 | 31-01-2021 | Phase 3 TaskName |
Name 2 | ID2 | 30-04-2021 | 31-01-2021 | Phase 4 TaskName |
Name 2 | ID2 | 28-02-2021 | 31-01-2021 | Phase 2 TaskName |
Name 2 | ID2 | 01-06-2021 | 30-06-2021 | Phase 6 TaskName |
Name 3 | ID3 | 01-01-2022 | 31-01-2021 | Phase 1 TaskName |
Name 3 | ID3 | 05-05-2022 | 31-01-2021 | Phase 5 Taskname |
Name 3 | ID3 | 01-06-2022 | 20-06-2021 | Phase 6 Taskname |
Desired result:
Name | ID | Phase | Phase start | Phase end | Description date start | Description date end | Description |
Name 1 | ID1 | Phase 1 | 01-01-2021 | 01-02-2021 | 01-01-2021 | 31-01-2021 | Phase 1 TaskName |
Name 1 | ID1 | Phase 2 | 01-02-2021 | 01-03-2021 | 01-02-2021 | 31-01-2021 | Phase 2 TaskName |
Name 1 | ID1 | Phase 3 | 01-03-2021 | 01-04-2021 | 01-03-2021 | 31-01-2021 | Phase 3 TaskName |
Name 1 | ID1 | Phase 4 | 01-04-2021 | 01-05-2021 | 01-04-2021 | 31-01-2021 | Phase 4 TaskName |
Name 1 | ID1 | Phase 5 | 01-05-2021 | 01-06-2021 | 01-05-2021 | 31-01-2021 | Phase 5 TaskName |
Name 1 | ID1 | Phase 6 | 01-06-2021 | 30-06-2021 | 01-06-2021 | 30-06-2021 | Phase 6 TaskName |
Name 2 | ID2 | Phase 1 | 30-01-2021 | 28-02-2021 | 30-01-2021 | 31-01-2021 | Phase 1 TaskName |
Name 2 | ID2 | Phase 2 | 30-05-2021 | 30-03-2021 | 28-02-2021 | 31-01-2021 | Phase 2 TaskName |
Name 2 | ID2 | Phase 3 | 30-03-2021 | 30-04-2021 | 30-03-2021 | 31-01-2021 | Phase 3 TaskName |
Name 2 | ID2 | Phase 4 | 30-04-2021 | 30-05-2021 | 30-04-2021 | 31-01-2021 | Phase 4 TaskName |
Name 2 | ID2 | Phase 5 | 28-02-2021 | 01-06-2021 | 30-05-2021 | 31-01-2021 | Phase 5 TaskName |
Name 2 | ID2 | Phase 6 | 01-06-2021 | 30-06-2021 | 01-06-2021 | 30-06-2021 | Phase 6 TaskName |
Name 3 | ID3 | Phase 1 | 01-01-2022 | Undefined | 01-01-2022 | 31-01-2021 | Phase 1 TaskName |
Name 3 | ID3 | Phase 5 | 05-05-2022 | 01-06-2022 | 05-05-2022 | 31-01-2021 | Phase 5 Taskname |
Name 3 | ID3 | Phase 6 | 01-06-2022 | 20-06-2021 | 01-06-2022 | 20-06-2021 | Phase 6 Taskname |