Can I join multiple tables based on text column?

Hello there,

I know my usage case is not ideal, but it is my real world :slight_smile:

I have an excel file whose sheets are gathered from multiple departments. I load this onto postgresql and run metabase on it.

almost all sheets have a departmentName column, which is populated with text. normally, if I was the one who created those sheets, I would have a deptID- deptName sheet and all sheets would use deptID and I could create my relations.

however, in my case I have several tables containing dept names in their rows (multiple times) and I can find no way to join these tables, is it possible?

sample table1
deptName - date - revenue
deptA - january - 100
deptA - february - 75
deptB - february - 100

Sample table2
billId - nameonbill - deptName - amount
1 - sasdas asd - deptA - 40
2 - gdfgfdg fgfd - deptA - 50
3 - kfgldfkg - dept B - 30

etc.

Can I create a table visualization where I have dept names in rows and sum of billing amounts and revenue amounts as columns

deptName - Sum of Revenue - sum of Bills
deptA - 175 - 90
deptB - 100 - 30

Hi @Bahadur
Yes, that should be possible - can you show a screenshot of what you’ve tried to do in the Custom question (notebook) editor?

1 Like

nevermind, i found it :slight_smile:

for those who might be as blind as me, there is a join table button in the editor which allows for such mapping

Just leaving this for those who might not be familiar with the notebook editor:
https://www.metabase.com/docs/latest/users-guide/custom-questions.html