Skip to main content
Hi Celopeers, How to pair activities..?
I have activities like A, B, C, D & E and I have Process flow for Case_ID

1 as ABCDBCE and 2 as ACD.

I want to pair activities(C to D or C to E) case_ID wise.

The output should will be 2(CD,CE) and 1(CD).

Could you try using PU_STRING_AGG to join the activities to the case table where each string will be the previous_activity and current_activity(Eg. CD). You will obtain (Eg. CD, CE). Then in another column do a count of commas in the aggregated_string column to obtain count (Eg. 2)

 

Example

LEN(PU_STRING_AGG("_CEL_CASE", ACTIVITY_LAG ("_CEL_ACT"."ACTIVITY_EN") || "_CEL_ACT"."ACTIVITY_EN", ','))

-

LEN(REPLACE(PU_STRING_AGG("_CEL_CASE", ACTIVITY_LAG ("_CEL_ACT"."ACTIVITY_EN") || "_CEL_ACT"."ACTIVITY_EN", ','), ',', '')) + 1

 

If you want to filter specific pairs to count for, you can add a filter expression in the PU_STRING_AGG function with a runtime variable


Reply