Creating joins based on the same database

Greetings,

To create a question I have to select which tables I want to work with.
To start in the question designer I choose a table.
In our case, I have to drill down a few levels.
Our Data -> Our Company Data Lake -> Our Company Name -> Table name.
That table name, whatever it is, say user_profiles for examples, holds all the user_profiles for all the databases in our data lake. Hence I need to filter it to only the one database I want to work with.

So say I want Orders and UserProfile as tables to have a join on their common user_id.
The Filter I set for the database I want to work with via 'database_name' filtering option however that filter only works for the first table, the Orders table.

As seen in this image of the question designer: https://imgur.com/a/TOZGvgL

What ends up happening is that the database filter only applies to the original table I created the question on first, i.e., the Orders table. That other table, UserProfile, is actually not restricted to that filter and host the users for the all the databases.

Is this a limitation of metabase due to the fact I have to drill down so many levels to reach the table I want to work with?

Hi @Antoine
Create a second condition on the join:
https://www.metabase.com/docs/latest/users-guide/join.html#joining-on-multiple-conditions

1 Like

Should you also not just use the 'inner join' instead of the 'left join'? Or am I missing something?

Thank you very much I just had to add the database_name filter to every table I add.