Skip to main content

Hi there,

i've been doing some tasks for uni and stumbled across a task where i need to return 'AB' if activity A happened before B and 'BA' if B happened before A. We can assume that always exactly one of the cases is true, so no null solutions.

I tried the following PQL formula but it doesnt seem to work:

 

CASE WHEN(PU_Last("case-table", "activity-table"."ACTIVITY", "activity-table"."ACTIVITY" = 'A') < PU_Last("case-table", "activity-table"."ACTIVITY", "activity-table"."ACTIVITY" = 'B'))

THEN 'AB'

ELSE 'BA'

END

 

For some reason the first case never happens. Anyone having any ideas?

Thanks for your help and kind regards

Aaron

Hi Aaron,

 

try this Formula IF A MUST BE DIRECTLY FOLLOWED by B:

 

  • CASE WHEN MATCH_PROCESS ( "Activities"."ACTIVITY" , NODE E 'A' ] as src , NODE E 'B' ] as trg CONNECTED BY DIRECT T src , trg ] ) = 1 THEN 'AB' ELSE 'BA' END

If an activity A has not only to be directly followed by B but can come any time later the keyword CONNECTED BY EVENTUALLY Y src , trg ] can be used.

For more details visit this link : MATCH_PROCESS (celonis.com)


Hi Rashid,

thank you very much for that fast response.

The formula works like a charm!


Hi Rashid,

thank you very much for that fast response.

The formula works like a charm!

Hi Aaron,

I'm so glad it was helpful :)


Reply