Skip to main content
Solved

Can i create a Conformance Ratio KPI (like on the Conformance Overview) using the conformance query

  • January 15, 2024
  • 7 replies
  • 19 views

Can i create a Conformance Ratio KPI (like on the Conformance Overview) using the conformance query

Best answer by janpeter.van.d

Hi Louis,

 

My bad, the syntax of the domain table is a bit different (with an underscore). Next to that, you need a closing bracket after the table column.

Please try:

 

AVG(CASE WHEN PU_SUM (DOMAIN_TABLE("_CEL_O2C_ACTIVITIES"."_CASE_KEY"), ABS (<%= conformanceKPIAm %>)) = 0 THEN 1 ELSE 0 END)

 

Best regards,

Jan-peter

7 replies

janpeter.van.d
Level 12
Forum|alt.badge.img+26
  • Level 12
  • 496 replies
  • January 15, 2024

Hi Louis,

 

That should be possible. The conformance query calculates per Activity if it is conform or not as described here: https://docs.celonis.com/en/conformance.html#idm45713625564912.

Your use case is described here in example 3:

  • First you calculate the conformance per Case, by using a PU_SUM of the absolute conformance score per activity. I would advise to return a 1 for conform cases and a 0 for non-conform cases.
  • Now you have 1 and 0 per case, you can just add an AVG operator, to calculate the ratio of conform cases.

 

I hope this helps!

 

Best regards,

Jan-peter


  • Author
  • Level 6
  • 16 replies
  • January 15, 2024

i thought about this as well, but it always says "Syntax error near [.] after reading [ AVG (CASE WHEN PU_SUM ("_CEL_O2C_ACTIVITIES"] at line 2. Please refer to PQL documentation for available syntax", my code is "AVG (CASE WHEN PU_SUM ("_CEL_O2C_ACTIVITIES"."ACTIVITY_EN", ABS (<%= conformanceKPIAm %>)) = 0 THEN 1 ELSE 0 END)" in the variable is the conformance query, and the activity table of the query is "_CEL_O2C_ACTIVITIES"

 


janpeter.van.d
Level 12
Forum|alt.badge.img+26
  • Level 12
  • 496 replies
  • January 15, 2024

Hi @Louis Forster,

 

There is indeed a syntax error. The first entry of the PU_SUM() function should be the table name where you want to pull your data to. Since you want a sum per case, this is likely to be your case table.

If you do not have a case table, you could use the CASE_KEY column of your activity table for this. Please fill in 'DOMAIN TABLE( "_CEL_O2C_ACTIVITIES"."<<CASE KEY COLUMN HERE>>") in the case table place holder below.

 

Your code will be:

 

"AVG (CASE WHEN PU_SUM ("<< CASE TABLE HERE >>", ABS (<%= conformanceKPIAm %>)) = 0 THEN 1 ELSE 0 END)"

 

I hope this helps!

 

Best regards,

Jan-peter


  • Author
  • Level 6
  • 16 replies
  • January 15, 2024

Hi Jan, thanks in general for your help. Even when i use it

 

"AVG (CASE WHEN PU_SUM (DOMAIN TABLE("_CEL_O2C_ACTIVITIES"."_CASE_KEY", ABS (<%= conformanceKPIAm %>)) = 0 THEN 1 ELSE 0 END)"

 

i still have a message error

 

"Syntax error near [DOMAIN] after reading [ AVG (CASE WHEN PU_SUM (] at line 2. Please refer to PQL documentation for available syntax."

 

Do you know a potential error source, thanks in advance :).

 

Best regards, Louis Forster


janpeter.van.d
Level 12
Forum|alt.badge.img+26
  • Level 12
  • 496 replies
  • Answer
  • January 15, 2024

Hi Louis,

 

My bad, the syntax of the domain table is a bit different (with an underscore). Next to that, you need a closing bracket after the table column.

Please try:

 

AVG(CASE WHEN PU_SUM (DOMAIN_TABLE("_CEL_O2C_ACTIVITIES"."_CASE_KEY"), ABS (<%= conformanceKPIAm %>)) = 0 THEN 1 ELSE 0 END)

 

Best regards,

Jan-peter


  • Author
  • Level 6
  • 16 replies
  • January 15, 2024

Hi Jan, it works :), such a big thank you. Have a nice Day. Best regards Louis


janpeter.van.d
Level 12
Forum|alt.badge.img+26
  • Level 12
  • 496 replies
  • January 15, 2024

Hi Jan, it works :), such a big thank you. Have a nice Day. Best regards Louis

Good to hear, happy to help!