Skip to main content

I have a case where I need to assign automatic or manual users based on 'Change Route' and the following activities that occurs simultaneously at the same time as 'Change in Delivery Date' and 'Change Confirmed Quantity'. But the logic that I'm using doesn't seem to be working. See code below:

 

CASE

  WHEN

  "_CEL_MERGED_ACTIVITIES"."ACTIVITY" IN ('Change Route')

  AND

    PU_FIRST(

    "VBAP",

    "_CEL_MERGED_ACTIVITIES"."TIMESTAMP",

    "_CEL_MERGED_ACTIVITIES"."ACTIVITY" IN ('Change Confirmed Quantity')

    )

    =

    PU_LAST(

    "VBAP",

    "_CEL_MERGED_ACTIVITIES"."TIMESTAMP",

    "_CEL_MERGED_ACTIVITIES"."ACTIVITY" IN ('Change Route')

    )

  THEN

    'Manual'

  WHEN

  "_CEL_MERGED_ACTIVITIES"."ACTIVITY" IN ('Change Confirmed Quantity')

  AND

    PU_FIRST(

    "VBAP",

    "_CEL_MERGED_ACTIVITIES"."TIMESTAMP",

    "_CEL_MERGED_ACTIVITIES"."ACTIVITY" IN ('Change Confirmed Quantity')

    )

    =

    PU_LAST(

    "VBAP",

    "_CEL_MERGED_ACTIVITIES"."TIMESTAMP",

    "_CEL_MERGED_ACTIVITIES"."ACTIVITY" IN ('Change Route')

    )

  THEN

    'Automatic'

END

Will not be easier doing that in Data Integration with SQL? then assigning the specific activity with _USER_TYPE= "A" or "M" ? Just wondering....


I'm not 100% following what the intention of your Case When statement is. The way it is written down currently, returns Manual for the activity change route and Automatic for the activity Change Confirmed Quantity if the criteria is met that the first timestamp of the change confirmed quantity is equal to the last timestamp of the change route activity. Is that what you are trying to accomplish?


Basically, when an activity 'Change Route' occurs (which is a manual change) the corresponding activities such as Change Confirmed Quantity and Change Confirmed Delivery Data that occurred at the same time should be made automatic. But the code that I have used, is not working. I have tried using PU_FIRST and PU_LAST in different combinations.

 

Subsequently, we had another use case where Change in Inco Terms and Release Credit Hold were Manual, and the Change Confirmed Quantity is automatic, and the same code mentioned above works fine for those activities.

 

So, we were wondering that if the same logic works for one activity, it should do that same for the others.

 

Hope these explanations help more on the topic discussed.


Making that in SQL will be much better idea, however assigning user type based on timestamp may lead to errors, at least when using SAP system as a data source.

 

https://docs.celonis.com/en/automation-rate---sap-ecc.html#UUID-2216a43a-9181-ec97-c94b-fe1b9212a989_id_AutomationRateSAPECC-QWhydontwejustcomparethenumberoftimestampsperminuteforauserinordertofindautomaticactivities


Reply