Skip to main content

I am trying to retrieve a count of a specific column based on a **CASE WHEN** condition using PQL. However, I am encountering the following error:  

 

*"A PQL error is preventing this query from executing. No common table could be found. The tables e"LINK"] and n"JS_PGT_Resolved"] are connected, but have no common table. This means that they do not have a direct (or indirect) 1:N or N:1 relationship. Join path: hLINK]N <-- 1! SUPPORTCASE]!1 --> N;JS_PGT_Resolved]. For more information on the join path, search for 'Join functionality' in PQL documentation."*  

 

I would appreciate any guidance on how to resolve this issue. Thank you!

 

Hi Prasanth, it depends on what exactly you want to achieve.

 

In Celonis, two tables can only be joined when they have a common table. If no common table exists between all tables used in the query, you will encounter the exact “No common table could be found” error that you’re seeing.

 

The reason for this is that your tables “LINK”] and I“JS_PGT_Resolved”] are both fact tables, meaning they are both on the N-side of the join graph. Celonis enforces an acyclic join graph, so there is only one valid join path between any two connected tables. More info here.

 

To resolve this issue, I suggest you PULL UP the column from the fact table “JS_PGT_Resolved” into the dimension table “SUPPORTCASE”. This ensures that "SUPPORTCASE" has a 1:N relationship with "LINK", making it possible to query both tables together.

 

For example, if you want to count "LINK"."<column_name>" but only when "JS_PGT_Resolved"."<column_name>" is not null, you could use:

COUNT(

   CASE WHEN PU_FIRST("SUPPORTCASE", "JS_PGT_Resolved"."<column_name>") IS NOT NULL

   THEN "LINK"."<column_name>"

   END

)

 

Note:

  • PU_FIRST("SUPPORTCASE", "JS_PGT_Resolved"."<column_name>"): this pulls the first non-null value of "JS_PGT_Resolved"."<column_name>" into "SUPPORTCASE" → More info on pull-up functions here

Hope this helps!


Hi Sakura, still am getting the same error 


Reply