Hi all,
In my activity table I have two specific activities named subprocess start and subprocess end. Before, between and after this two activities there are other activities and I need to count how many happened before, during and after the subprocess.
Each activitiy has an eventtime, but I'm not able to compare them.
Approaches already tried (for now I'm focusing on activities happened BEFORE, since I thought that it would have been easy to add other case when for during and after scenarios afterwards:
(CASE WHEN DATEDIFF(ms, "ACTIVITY_TBL"."EVENTTIME",
CASE WHEN "ACTIVITY_TBL"."ACTIVITY_NM" = 'subprocess start'
THEN "ACTIVITY_TBL"."EVENTTIME" END) > 0
THEN '1' ELSE 0 END)
(CASE WHEN "ACTIVITY_TBL"."EVENTTIME" <
CASE WHEN "ACTIVITY_TBL"."ACTIVITY_NM" = 'subprocess start'
THEN "ACTIVITY_TBL"."EVENTTIME" END
THEN 1 ELSE 0 END)
Both are giving me 0 everywhere, even if I see that in the specific case that I'm using as example, there are activities before, during and after.
Where am I wrong here? Thanks