Skip to main content

Hello,

We want to write a formula to collect the NOV amounts of the people with all two constraints, can you help?

 

CASE WHEN "_CEL_P2P_ACTIVITIES"."USER_NAME"='X' AND ("_CEL_P2P_ACTIVITIES"."ACTIVITY_EN" = 'Submit Purchase Order') AND "_P2P_TCL_POSITIONS_V3"."eylem_sahibi_division" = 'CORPORATE LEGAL AFFAIRS'

THEN KPI(NOV)

WHEN "_CEL_P2P_ACTIVITIES"."USER_NAME"='Y' AND ("_CEL_P2P_ACTIVITIES"."ACTIVITY_EN" = 'Submit Purchase Order') AND "_P2P_TCL_POSITIONS_V3"."eylem_sahibi_division" = 'CORPORATE LEGAL AFFAIRS'

THEN KPI(NOV)

...

ELSE 0

END

Hello Hande,

 

If I understood the issue correctly, you could simplify your code if all other conditions are the same by including only one condition by using the operator IN like:

 

CASE WHEN

 

"_CEL_P2P_ACTIVITIES"."USER_NAME" IN ('X','Y','Z'.....)

AND ("_CEL_P2P_ACTIVITIES"."ACTIVITY_EN" = 'Submit Purchase Order')

AND "_P2P_TCL_POSITIONS_V3"."eylem_sahibi_division" = 'CORPORATE LEGAL AFFAIRS'

THEN KPI(NOV)

ELSE 0

END

 

 

Hope this helps you solve your issue.

 

Best regards,

Pablo


Hello Hande,

 

If I understood the issue correctly, you could simplify your code if all other conditions are the same by including only one condition by using the operator IN like:

 

CASE WHEN

 

"_CEL_P2P_ACTIVITIES"."USER_NAME" IN ('X','Y','Z'.....)

AND ("_CEL_P2P_ACTIVITIES"."ACTIVITY_EN" = 'Submit Purchase Order')

AND "_P2P_TCL_POSITIONS_V3"."eylem_sahibi_division" = 'CORPORATE LEGAL AFFAIRS'

THEN KPI(NOV)

ELSE 0

END

 

 

Hope this helps you solve your issue.

 

Best regards,

Pablo

Hello Pablo,

 

First of all thank you for your answer, but actually I need a formula where all other conditions ( activity & position) are also variable/changeable.

I would be very happy if you have a chance to support me in this matter, too.

 

Best,

Hande


Hello Hande,

 

In that case you just need to follow the syntax of the CASE WHEN function (https://help.celonis.cloud/help/display/CIBC/CASE+WHEN) and apply the logic needed for your given case.

 

If all other conditions can be variable but they do not need to match a given combination the can be grouped in similar example that I gave you with the use of operator IN.

If only a given combination of variables should be valid, in that case you need to nest multiple conditions similarly to what your initial approach was.

 

Hope this helps you solve your issue.

 

Best regards,

Pablo

 


Reply