Skip to main content

Is there a way to combine conditions across tables in a PQL query or is it required to join tables beforehand in order to be used in a PQL query?

 

 

Here is an Examples:

 

I want to go from this:

CASE

WHEN ISNULL("LIKP"."ZZTERMIN_DATE")=1 AND ISNULL("LIKP"."ZZFRTER")=1 THEN 'Ohne Termine (Ohne frühster & Ohne Fixtermin'

 WHEN ISNULL("LIKP"."ZZTERMIN_DATE")=0 AND ISNULL("LIKP"."ZZFRTER")=0 THEN 'Mit beiden (Mit frühstem & Fixtermin)'

 

 WHEN ISNULL("LIKP"."ZZTERMIN_DATE")=1 AND ISNULL("LIKP"."ZZFRTER")=0 THEN 'Nur mit frühstem Termin (ohne Fixtermin)'

 WHEN ISNULL("LIKP"."ZZTERMIN_DATE")=0 AND ISNULL("LIKP"."ZZFRTER")=1 THEN 'Nur mit Fixtermin (ohne frühster Termin)'

 END

 

 

To this:

CASE

 WHEN "LIPS.LFIMG" <> '0' AND ISNULL("LIKP"."ZZTERMIN_DATE")=1 AND ISNULL("LIKP"."ZZFRTER")=1 THEN 'Ohne Termine (Ohne frühster & Ohne Fixtermin'

 

 WHEN "LIPS.LFIMG" <> '0' AND ISNULL("LIKP"."ZZTERMIN_DATE")=0 AND ISNULL("LIKP"."ZZFRTER")=0 THEN 'Mit beiden (Mit frühstem & Fixtermin)'

 

 WHEN "LIPS.LFIMG" <> '0' AND ISNULL("LIKP"."ZZTERMIN_DATE")=1 AND ISNULL("LIKP"."ZZFRTER")=0 THEN 'Nur mit frühstem Termin (ohne Fixtermin)'

 

 WHEN "LIPS.LFIMG" <> '0' AND ISNULL("LIKP"."ZZTERMIN_DATE")=0 AND ISNULL("LIKP"."ZZFRTER")=1 THEN 'Nur mit Fixtermin (ohne frühster Termin)'

END

 

Right now I am joining LIKP with LIPS and VBAP in order to use the CASE WHEN function directly on VBAP. This works but I am curious to know If there was another way of doing in Process Analytics directly?

 

Kind regards,

Saša

Hi @sasa.redze12 , my take on this is that you need the join before hand in the data model (How can then the analytics understand that there is a relationship?). Good question thought to have an alternative approach. Let's see if there is a different way!!


HI @sasa.redze12 CASE WHEN will fetch the data only if there will be relation between table, So I believe there should be join between tables if we want to fetch the records from two different tables.

 

But yes there might be workaround, so let's see if some other opinion comes up.

 

Happy Learning!

 

 


I can only support the two above opinions. My take would be to try it out and see what the result will be. Would also be interested if it returns NULL or an error in this case.


Reply