I have several products that go through similar processes till they are finished and i want to calculate the duration for each step. Here an example
ItemID | Status | Date |
---|---|---|
1 | Fabrication | 01-01-2024 |
1 | Installation | 05-01-2024 |
1 | Test | 10-01-2024 |
1 | Handover | 15-01-2024 |
2 | Fabrication | 01-02-2024 |
2 | Installation | 06-02-2024 |
2 | Test | 12-02-2024 |
2 | Handover | 17-02-2024 |
I Want to create Report based on linq query with result similar to the following :
ItemID | Status | Date | Duration |
---|---|---|---|
1 | Fabrication | 01-01-2024 | – |
1 | Installation | 05-01-2024 | 4 |
1 | Test | 10-01-2024 | 5 |
1 | Handover | 15-01-2024 | 5 |
2 | Fabrication | 01-02-2024 | – |
2 | Installation | 06-02-2024 | 5 |
2 | Test | 12-02-2024 | 6 |
2 | Handover | 17-02-2024 | 5 |
Where predecessor process date is subtracted from successor process date to get the duration in days.