Tableau Data Blending

Tableau Data Blending is very useful to join or combine records from two data sources. For example, If you want to generate a report using multiple or different datasources, then we can use this Tableau Data Blending technique to join them. For this data blending demo, we use the sheets present in the Excel Worksheet and SQL Server.

Tableau Data Blending Approach 1

To perform Tableau Data Blending or combining, we need at least one common dimension in both sources. It doesn’t matter whether it is an integer or string. To demonstrate Tableau Data Blending, First, we connected to the primary data source Employees.xlsx workbook and added the secondary data source Employee List sheet to the region

Excel Workbook

In this Tableau Data Blending example, We require to create a table report with the employee’s first name, last name, occupation, Sales, and yearly income.

So, we created a simple table report with Occupation, Last name, First name on Rows and Sales Amount, and Yearly income on columns. Let us see the report preview.

Please refer to Connecting to Excel Files and Connecting to Server in Tableau.

Table Report

Scenario: Suddenly, the Client changed the requirements and asked us to add department and Salary Hike percentage details for every Employee. Here the real obstacle is, department and Salary Hike percentage columns are present in the Master SQL Server database.

It means we have to combine a few columns from the primary data source Local Excel Sheet and the records from the secondary data source, a few others from SQL Database. It is what we call as Tableau Data Blending.

To do this Tableau data blending of primary and secondary data sources or multiple data sources, Please navigate to Data menu. Next, select New Data Source option from Menu or click on the Cylinder symbol

Add New Data Source to existing report

After you choose the option, the below-shown window will appear to Connect. Here, we have to connect with SQL so select Microsoft SQL Server

Connect to Microsoft Sql Server

We picked the Department table from the Database for the Tableau Data Blending.

Select Database Tables

The newly added data source (SQL) Department table, and this is coming from the secondary data sources.

Data Blending In Tableau 6

Let us add the Department name to the Rows Card. As you see that the desktop is displaying a little orange tick mark at the department name. It is also displaying the warning message.

If you read the warning message, it is a pretty straightforward message saying that there is no relation between Employees and departments. A relationship is significant to perform data blending in tableau. Please add the connection.

Relationship Warning 7

To add a relationship, Go to data menu and select Edit Relationships.. option.

Data Blending In Tableau 8

Once you choose the Edit Relationships.. option, a new Relationships window will open. The following are the available options for Tableau Data Blending.

  • Primary Data Source: From which we first dragged the fields (Dimension or Measure) into the report region called as a Primary datasource. The desktop will display little Blue tick mark beside this one.
  • Secondary Data Source: Which is not primary. It shows a small orange tick mark beside secondary datasource
  • Automatic: If there are any common dimension names in both the datasources, the desktop automatically detects the possible relationship between those two fields.
  • Custom: If there are no common Field names in the primary and secondary datasources, We have to select the Custom option. And then add the relationship between them. For now, we are choosing this option
Data Blending In Tableau 9

Dept ID in Employee table and Id in Department table are the key columns. We are going to use them for this Tableau Data Blending on Employee and Department table.

Data Blending In Tableau 10

Once you specified the relationship, a tiny URL link will appear beside the Id column. From the below screenshot, when you hover on that link, Use Id as linking field tooltip is displaying. Click the link button to enable Data blending in tableau

Data Blending In Tableau 11

When you click the link button, the link button color will change to orange color, and our Department column is displaying records. Remember, If there are no matching records in the Department, then Null values will be displayed.

Data Blending In Tableau 12

Let us add a Hike Rate measure to complete our client requirements.

Data Blending In Tableau 13

Tableau Data Blending Approach 2

The second approach of Tableau Data Blending is simple and straightforward. Instead of creating custom relationships between Id and Dept ID columns, let’s give a chance to this desktop intelligence

Data Blending In Tableau 14

To do this, Please select and right-click on the Id column. Next, choose the Aliases.. option from it.

Data Blending In Tableau 15

Once you decided the Aliases.. option, a new window will be popped up to rename the filed. Let us change the Id Column to Dept ID

Data Blending In Tableau 16

Once you click the OK button, it will automatically detect the relationship between Dept ID in Employee and Dept ID in the Department table. It means you don’t have to create a relationship on your own.

You can observe that a tiny URL link will appear beside the Dept ID column. Click the link button to enable Tableau Data Blending

Data Blending In Tableau 17

Once you click on the link button, the link button color will be changed to Orange color.

Data Blending In Tableau 18

Let us add Department Name and Hike Rate to finish the business requirement.

Remove or Edit Tableau Relationships

We show you how to remove relationships that we created in Tableau data blending process. First, please navigate to Data menu and select Edit Relationships.. option.

Edit Table Relationships

Once you select Edit Relationships.. option, a new Relationships window will open. Please choose the Relationship you want to remove and click the Remove button. In this Tableau Data Blending example, we have only one relationship between Dept ID and Id so, we selected it and removed it.

Data Blending In Tableau 20

The following warning message is displayed because we are using Department Name and Hike Rate in the report.

Data Blending In Tableau 21

Next, One more warning message which we have seen before. Once you click OK button, Tiny URL link will be removed besides the Id column.

We successfully removed the relationship required for Tableau Data Blending.

Relationship between two data Sources error

Comments are closed.