Hello Henning,
Thank you for your question.
Yes it is possible to use a CALC_CROP function within a CASE WHEN! At first glance I believe you are looking for something like this: ( Quick note: the TO_TIMESTAMP() function is deprecated, hence I have replaced it with TO_DATE() instead )
CASE WHEN
CALC_CROP(LAST_OCCURRENCEN'Change Requested Delivery Date']
TO FIRST_OCCURRENCEN'Change Confirmed Delivery Date'], "_CEL_O2C_ACTIVITIES"."ACTIVITY_EN")
IS NOT NULL
THEN
TO_DATE(PU_FIRST("VBAP", "_CEL_O2C_ACTIVITIES"."CHANGED_TO",
"_CEL_O2C_ACTIVITIES"."ACTIVITY_EN" = 'Change Confirmed Delivery Date'), FORMAT('%Y-%M-%D')
)
ELSE "VBEP"."EDATU" END
However, I would need more context if possible please of what you are trying to achieve with the overall function to be sure. Please let me know if the above is not what you are looking for.
Thank you!
Hello Henning,
Thank you for your question.
Yes it is possible to use a CALC_CROP function within a CASE WHEN! At first glance I believe you are looking for something like this: ( Quick note: the TO_TIMESTAMP() function is deprecated, hence I have replaced it with TO_DATE() instead )
CASE WHEN
CALC_CROP(LAST_OCCURRENCEN'Change Requested Delivery Date']
TO FIRST_OCCURRENCEN'Change Confirmed Delivery Date'], "_CEL_O2C_ACTIVITIES"."ACTIVITY_EN")
IS NOT NULL
THEN
TO_DATE(PU_FIRST("VBAP", "_CEL_O2C_ACTIVITIES"."CHANGED_TO",
"_CEL_O2C_ACTIVITIES"."ACTIVITY_EN" = 'Change Confirmed Delivery Date'), FORMAT('%Y-%M-%D')
)
ELSE "VBEP"."EDATU" END
However, I would need more context if possible please of what you are trying to achieve with the overall function to be sure. Please let me know if the above is not what you are looking for.
Thank you!
Thanks for your answer.
I already found the correct solution :)