Input –
I want to derive a column based on below steps –
- Check for same ServiceId and Name but Ref is different.
- If so, then calculate day diff like below –
(take ActualEndTime from 1st row and CreatedDate from 2nd row if ServiceId and Name are matched for diff Ref)
- Then derive a column ‘Flag’ based on DayDiff calculated in step 2.
If DayDiff is greater than 30, then Flag should be 0 else 1
(take ActualEndTime from 1st row and CreatedDate from 2nd row if ServiceId and Name are matched for diff Ref)