Setting Tableau Data Sources
Updated: Sep 4, 2020
Tableau data source is the link between your data and Tableau. After connecting data to Tableau, all the configurations that you set up at the data source page before beginning your analysis make up the data source which Tableau uses to interpret and interact with your data.
The Tableau data source can contain;
Information about where the data is located, such as file name and path or a network location.
The names of any tables in the connection, as well as information about how the tables relate to each other.
A layer of customization's that make on top of your data but are not part of the original data itself such as calculations, groups and renamed fields.
Before setting up your Tableau data source, it’s important to know whether your data is stored in one table or in multiple tables.
The following are different ways of setting Tableau data source;
When data comes from a single table
When your data comes from a single table, the Tableau data source can be created by connecting to your data and dragging the single table to the canvas. (In reality Tableau will automatically load the single table to the canvas). Then start building your views.
When data comes from multiple tables from the same database
If your data comes from multiple tables in the same database. You can create Tableau data source by connecting to your data and then combining the tables in Tableau. Such Tableau data source has a single connection to the database that contains all the tables you need in your analysis.
The following are ways to combine data from multiple tables depending on the data you working with;
When data comes from multiple tables from different databases
If your data comes from multiple tables in different databases. You can create Tableau data source by connecting to your data and then combining the tables in Tableau. But before combining the tables you must decide between setting up;
An individual data source for each connection to the database that contains the tables that you need for your analysis, or
A single data source with multiple independent connections to all tables you need for your analysis.
Once you decide on your set-up, you can combine your data either through;
Data blending – supports one connection per data source and one data source per database.
Cross database joins – allows two or more connections per data source.
Ways to combine your data in Tableau
There are three ways you can combine data in Tableau; Join, blend and union.
Joining is a method of combining tables related by a common field. The result of combining data using a join is a virtue table that extends horizontally by adding columns of data.
For example, let say you are analyzing data on sales to compare last month commission payout with the current month. The data might exist in two tables like in the example below;
To analyze this data, you can join the two tables using the common field ‘Id’ to create a single data that can enable comparison of commission paid out for the two months.
Unioning is a method of appending values (rows) to tables. You can union tables if they have the same columns (structure). Unioning data results to a virtue table with same columns but that extends vertically by adding rows of data.
For example, let say you’re analyzing performance of different products for different quarters of the year.
Such data might be residing in four different tables of the same structure, see below.
To analyze such data, you can union the four tables to create a single table which will enable you do the analysis.
Data blending is another way of combining data using the so called primary data source with common fields from one or more secondary data sources.
Unlike joining, data blending keeps the data sources separately and simply displays their information together.
Data blending is ideal when;
Data is at different levels of detail.
You want to combine data from different databases that are not supported by cross-database joins.
You have lots of data.
Setting up your Tableau data source will depend with the kind of data you’ve and the questions you need to answer. A well configured Tableau data source will help you quickly build views and answer your business questions.
I hope this was helpful to you.
Thank you for reading.