Skip to main content

Can I get values from a referenced case?

 

Hi, in my datamodel the cases are customer's orders. An order can get paused due to other order of the same customer. In this case the first order also has the CaseID of the blocking order as a reference in the CASE table.

 

Now I want to show each CaseID in a column and a value from the referenced Case in a seperate column.

 

 

I.e. I want to say something like:

"Give me the value "CASE"."ORDER_TYPE" of the case whose CASE_ID is referenced in THIS case's column "CASE"."BLOCKED_BY".

 

All attempts with Pull-Up and Domain_Table statements failed.

Any ideas?

 

BR Florian

Without testing, but I'd try something like:

 

PU_LAST(DOMAIN("CASE"."CASE_ID"),"CASE"."ORDER_TYPE", "CASE"."CASE_ID"="CASE"."BLOCKED_BY")


Without testing, but I'd try something like:

 

PU_LAST(DOMAIN("CASE"."CASE_ID"),"CASE"."ORDER_TYPE", "CASE"."CASE_ID"="CASE"."BLOCKED_BY")

Unfortunately then it also takes the "CASE"."BLOCKED_BY" value from the child table.

PQL would need something like the keyword THIS in programming languages.

 

PU_LAST(DOMAIN("CASE"."CASE_ID"),"CASE"."ORDER_TYPE", "CASE"."CASE_ID"=THIS."CASE"."BLOCKED_BY")

 

Then it would be clear which table the column has to be taken from.

But thank you for the suggestion! :)


Unfortunately then it also takes the "CASE"."BLOCKED_BY" value from the child table.

PQL would need something like the keyword THIS in programming languages.

 

PU_LAST(DOMAIN("CASE"."CASE_ID"),"CASE"."ORDER_TYPE", "CASE"."CASE_ID"=THIS."CASE"."BLOCKED_BY")

 

Then it would be clear which table the column has to be taken from.

But thank you for the suggestion! :)

Do you mean that in the output you get several correct answers AND a line with the blocking case_id? in that case you could refine the filter with AND CASE.CASE_ID <> CASE.CASE_ID

 

But, yes, that "THIS" will help a lot... I have found that, specially with PU, PQL requires lot of "try-and-error"

 


Unfortunately then it also takes the "CASE"."BLOCKED_BY" value from the child table.

PQL would need something like the keyword THIS in programming languages.

 

PU_LAST(DOMAIN("CASE"."CASE_ID"),"CASE"."ORDER_TYPE", "CASE"."CASE_ID"=THIS."CASE"."BLOCKED_BY")

 

Then it would be clear which table the column has to be taken from.

But thank you for the suggestion! :)

try-and-error -> absolutely!

 

When I use a statement like your's I am getting only NULL values. That is because Celonis only looks into the child table (for both sides of the condition). So it look if a Case is blocked by itself, which is of course never true and also not what I want.


Unfortunately then it also takes the "CASE"."BLOCKED_BY" value from the child table.

PQL would need something like the keyword THIS in programming languages.

 

PU_LAST(DOMAIN("CASE"."CASE_ID"),"CASE"."ORDER_TYPE", "CASE"."CASE_ID"=THIS."CASE"."BLOCKED_BY")

 

Then it would be clear which table the column has to be taken from.

But thank you for the suggestion! :)

Damm... I didn't know this "that is because Celonis only looks into the child table (for both sides of the condition)"

 

I will dig into the documentation to see if I can imagine some "hack" to reference also the parent table in the filter


Reply