Skip to main content
Percentage of a selected variant
I want to calculate the percentage variant 1 which is happy path.

You can use the following to get the desired result

 

MAX(PU_COUNT(DOMAIN_TABLE(VARIANT("_CEL_P2P_ACTIVITIES"."_ACTIVITY_EN")), "EKPO"."_CASE_KEY"))

/ COUNT("EKPO"."_CASE_KEY")

 

The following code give you # Cases per Variant

 

PU_COUNT(DOMAIN_TABLE(VARIANT("ACTIVITIES"."ACTIVITY_EN")), "CASE_TABLE"."CASE_KEY")

 

Hence MAX would give to the highest # Cases per variant i.e. variant 1 which is happy path.

 

MAX(PU_COUNT(DOMAIN_TABLE(VARIANT("ACTIVITIES"."ACTIVITY_EN")), "CASE_TABLE"."CASE_KEY"))

 

Now dividing the same with Case Key from the Case table gives you the desired %, hence

 

MAX(PU_COUNT(DOMAIN_TABLE(VARIANT("ACTIVITIES"."ACTIVITY_EN")), "CASE_TABLE"."CASE_KEY")) /

COUNT("CASE_TABLE"."CASE_KEY")

 

Hope this helps !


You can use the following to get the desired result

 

MAX(PU_COUNT(DOMAIN_TABLE(VARIANT("_CEL_P2P_ACTIVITIES"."_ACTIVITY_EN")), "EKPO"."_CASE_KEY"))

/ COUNT("EKPO"."_CASE_KEY")

 

The following code give you # Cases per Variant

 

PU_COUNT(DOMAIN_TABLE(VARIANT("ACTIVITIES"."ACTIVITY_EN")), "CASE_TABLE"."CASE_KEY")

 

Hence MAX would give to the highest # Cases per variant i.e. variant 1 which is happy path.

 

MAX(PU_COUNT(DOMAIN_TABLE(VARIANT("ACTIVITIES"."ACTIVITY_EN")), "CASE_TABLE"."CASE_KEY"))

 

Now dividing the same with Case Key from the Case table gives you the desired %, hence

 

MAX(PU_COUNT(DOMAIN_TABLE(VARIANT("ACTIVITIES"."ACTIVITY_EN")), "CASE_TABLE"."CASE_KEY")) /

COUNT("CASE_TABLE"."CASE_KEY")

 

Hope this helps !

Hello Abhishek Chaturvedi,

Many thanks for your reply. I tried it. It works fine for the initial scenario when I dont have any selections& filters from dropdowns or so. Unfortunately, it did not work correctly when I chose a Order type. I want the code works dynamically based on my selections like it is in Process Overview.

 

imageimage 

Additionally,

 

If the happy path follows the process flow A>B>C>D>E>F; below code works for the initial case.

But again, I wonder the dynamic code :)

AVG (MATCH_PROCESS_REGEX ( "_CEL_PM_ACTIVITIES"."ACTIVITY_EN",

^'A'

>> 'B'

>> 'C'

>> 'D'

>> 'E'

>> 'F'$))

 

kind regards,

Zeliha


Reply