Hi, I am unable to understand how to process this, neither could find anything related to it. For below scenario, i need to group based on message reference first, then pick the date from start column (which I have processed it to be empty for status 9 and some value for status 13) and then other way pick end date from that column and find the differece. I have a logic for finding the difference between 2 dates just need to know how will I incorporate the group by and subtract 2 different columns.
PS. I want to do is, For each message reference, say X, pick start date from status 13 and end date from status 9 and subtract them. I got the logic for date subtraction so for that I need both dates in 1 line. Any idea?
| Status | Message reference | Time changed | Start | END |
| 9 | X | 14:25:21 | | 12/11/2019 14:25 |
| 13 | X | 14:17:40 | 12/11/2019 14:09 | |
| 9 | Y | 16:35:38 | | 12/11/2019 16:35 |
| 13 | Y | 16:34:35 | 12/11/2019 15:09 | |