Creating a Cross-Database Union in Tableau Desktop

Data

Creating a Cross-Database Union in Tableau Desktop

by
//

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.

More About the Author

Crash Kaggle Challenge Digit Recognizer with Dataiku Auto-Coding Are you not yet confident enough to announce that you are a data scientist because you haven’t programmed a model yourself with a ...
Creating a Cross-Database Union in Tableau Desktop 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 ...

See more from this author →

InterWorks uses cookies to allow us to better understand how the site is used. By continuing to use this site, you consent to this policy. Review Policy OK

×

Interworks GmbH
Ratinger Straße 9
40213 Düsseldorf
Germany
Geschäftsführer: Mel Stephenson

Kontaktaufnahme: markus@interworks.eu
Telefon: +49 (0)211 5408 5301

Amtsgericht Düsseldorf HRB 79752
UstldNr: DE 313 353 072

×

Love our blog? You should see our emails. Sign up for our newsletter!