Calculate activity status duration, ignoring other activities' status changes Hi Celopeers :) We have a specific use case, based on JIRA data. For a case a limited set of activities (~7, JIRA stories) need to be performed. For each activity (/story) we know when it was ready for pickup, in progress, and done (or rejected). If we would like to calculate the total time the activity/story spent in the status 'in progress' I was thinking of something like this: SUM( CASE WHEN "TABLE_STATUS"."STATUS" = 'In progress' THEN HOURS_BETWEEN("TABLE_STATUS"."STATUSDATETIME",ACTIVITY_LEAD("TABLE_STATUS"."STATUSDATETIME")) / 24 --to get fractional days ELSE 0.0 END) Where the dimension could be the different activity/story names for instance. However, the activity_lead often is a very different activity (/JIRA story), hence the calculation fails.I also cannot use a process pattern matching using first and last occurrence, as an activity can be 'in progres' multiple times and I would need to