Count number of times activity is followed by activity X


#1

Hi,

We would like to replicate the ‘directly preceded by’ list in the process explorer, i.e., we have a list of activities and their number of occurrences and would like to add a KPI/column that counts how often this activity was directly followed by a fixed activity X.

How could I achieve this? Match_activities / Match_process does not allow for variable activity references (i.e. the current row).


#3

Never tried it myself for your case, however if you are on Celonis 4.3+ look into new SOURCE/TAGRET PQL function.


#4

Hi Nikolai,

Thanks for the pointer. Source/Target are not listed in the PQL list (in 4.4) so I did not know of their existence.

Since it took me some time to get my head around it’s usage, here is how I applied it:
Add add a dimension as follows:
Source("YOUR_ACTIVITY_COLUMN_HERE")
Then add a KPI column as follows:

SUM(CASE WHEN Target("YOUR_ACTIVITY_COLUMN_HERE") LIKE 'MY_TARGET_ACTIVITY_NAME_HERE' THEN 1 ELSE 0 END)

I do get slightly different results for some activities, while for others I get the same numbers as in the process explorer stats. Will post here when I figure that one out.