Hello community,
I am trying to build a table that will have a ranking of company codes. I use Celonis 4.5 on-prem. The company codes are my dimension. This ranking is based on the below KPI logic:
CASE WHEN
MAX(WORKDAYS_BETWEEN(R2R.Tables::BSEG_KDAS.CAL_ID, R2R.Tables::BSEG_KDAS.LAST_DAY_OF_MONTH,
(PU_MAX( DOMAIN_TABLE (
R2R.Tables::BSEG_KDAS.ENTRY_DATE,R2R.Tables::BSEG_KDAS."_CASE_KEY"),R2R.Tables::BSEG_KDAS.ENTRY_DATE)))) = 3
THEN 1
WHEN
MAX(WORKDAYS_BETWEEN(R2R.Tables::BSEG_KDAS.CAL_ID, R2R.Tables::BSEG_KDAS.LAST_DAY_OF_MONTH,
(PU_MAX( DOMAIN_TABLE (
R2R.Tables::BSEG_KDAS.ENTRY_DATE,R2R.Tables::BSEG_KDAS."_CASE_KEY"),R2R.Tables::BSEG_KDAS.ENTRY_DATE)))) = 4
THEN 2
ELSE NULL
END
the above statement works as expected, however i need to include another variable where it also checks for the time stamp.
I have tried the below statement, however am receiving an error message saying An aggregation is not a function.
Can you please suggest a solution that incorporates both the max day function and the time stamp?
CASE WHEN
(R2R.Tables::BSEG_KDAS.CPUTM > 120000 AND
MAX(WORKDAYS_BETWEEN(R2R.Tables::BSEG_KDAS.CAL_ID, R2R.Tables::BSEG_KDAS.LAST_DAY_OF_MONTH,
(PU_MAX( DOMAIN_TABLE (
R2R.Tables::BSEG_KDAS.ENTRY_DATE,R2R.Tables::BSEG_KDAS."_CASE_KEY"),R2R.Tables::BSEG_KDAS.ENTRY_DATE)))) = 3)
THEN 1
WHEN (R2R.Tables::BSEG_KDAS.CPUTM < 120000 AND
MAX(WORKDAYS_BETWEEN(R2R.Tables::BSEG_KDAS.CAL_ID, R2R.Tables::BSEG_KDAS.LAST_DAY_OF_MONTH,
(PU_MAX( DOMAIN_TABLE (
R2R.Tables::BSEG_KDAS.ENTRY_DATE,R2R.Tables::BSEG_KDAS."_CASE_KEY"),R2R.Tables::BSEG_KDAS.ENTRY_DATE)))) = 3)
THEN 2
ELSE NULL
END
Thanks,
Anna