Yes, most of the time it is possible to connect and join on common column if the fields are same as well as data type should be same in both the data sources.
Thank you for the reply. My bad, I should have mentioned that the Calculated field is not calculated in the database. It's calculated it Tableau.
Tableau doesn't let you select CALCULATED fields as a key to create a join, only the original fields from the database.
That's why I was wondering if it's possible to do it via Custom SQL?
Yes, both fields have the same data type.
1 of 1 people found this helpful
It's not possible to create the calculation in Tableau and join on that using Custom SQL. It's possible to do the calculation in SQL and join on that before pulling the data into Tableau. Note it's quite unusual to join database tables on a measure.
Thank you Andrew!
The field is a dimension, but it consists of 5 digits, so it's possible to do some calculations.
I've done this screenshot to explain something else, but it would show what I'm trying to achieve. It's very easy to do it in Excel, but not in Tableau.
I thought I could use left join and link this table to itself: Calculated field = Drug Code Xid, it would record the sub-category name (Drug_Code_Desc) in each row (as shown).
Anyway, I'm just a pharmacist and SQL coding is a too advanced option for me... Thank you again for your time and for answering my question!
You can definitely do this using SQL, however it would require a reasonably advanced level of SQL to write it.