Data in the real world is a lot messier than we’d imagine it to be. More often than not, working with data will involve multiple sources. For example, you might want to combine two tables, like sales from subsequent quarters.
In Tableau Desktop, this is made simple with the Union operation, which allows us to append rows of one table onto another one. However, this operation does not allow combining data sources from different databases. (Tableau Prep offers a union function, but let’s assume that it is unavailable and your boss needs the job done right and quickly.)
The solution? A cross-database join. In a few simple steps, we can trick Tableau into creating an outer join to extend the table vertically:
Combine Data Sources from Different Databases
Here’s how we can get the joining result we’re looking for. First, create a full outer join of two tables from different databases based on equality condition, i.e. by using calculated fields where 1 equals 2:
Next, create combined fields by IFNULL() function:
This simple workaround allows Tableau Desktop to union tables across databases without an ETL tool. It’s a quick and dirty solution that comes with a cost of increased data structure complexity. But don’t be afraid of using it. Just be mindful not to add more data tables, thus causing maintenance and troubleshooting problems in the long run.