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
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"
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
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 aDOMAIN] after reading n 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
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
Hi Jan, it works , such a big thank you. Have a nice Day. Best regards Louis
Hi Jan, it works , such a big thank you. Have a nice Day. Best regards Louis
Good to hear, happy to help!
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.