Tableau Data Blending – Types of Data Blending in Tableau

1. Objective

In this tutorial for Tableau, we will learn about Tableau Data Blending, how to create Data Blending and use it.
So let us start today’s journey with Tableau Data Blending.

What is Tableau Data Blending

Tableau Data Blending – Introduction

2. Introduction to Tableau Data Blending

Information blending is an intense component in Tableau. It is utilized when there is connected information in different information sources which is broke down together in a solitary view.
For example, the sales information is available in a social database and sales target information in an excel spreadsheet. At that point to contrast real deals with target deals, the information is mixed in light of normal measurements to access the sales target measure. The two sources engaged with information mixing have alluded as primary and auxiliary information sources. A left join is made between the essential information source and the auxiliary information source with every one of the information columns from essential and coordinating information lines from an optional information source.
Let’s revise Tableau data sources & Tableau design flow

3. How to Create Data Blending in Tableau

A scene has two inbuilt information sources named Sample-superstore and Sample espresso chain.mdb which we will use to delineate information mixing. To begin with stack the example espresso bind to a scene and take a gander at its metadata.

Process - Tableau Data Blending

Process – Tableau Data Blending

4. Types of Tableau Data Blending.

There are two types of data blending in Tableau.

a. Automatically Defined Relationship

The automatically defined relationship for data blending in Tableau, data works best only if the field in which we are working on has the field name same for both of sources of data, if not we have alias the names so they can match.
The superstore data source contains geographic sales data. What if you wanted to know what the per capita sales for each state were for the year 2012? The superstore data set doesn’t include population data. But, the United States Census Bureau website has population data. The data was downloaded from the web. Just two columns of data are included in the table. It is important to note the field description for a state. The field name for the blend must be the same in the superstore and the census data file for automatic blending to work in Tableau. If the fields are not the same you will need to edit the name in the spreadsheet or rename the fields in Tableau so that they match.

Tableau Worksheet

Tableau Worksheet

To automatically blend the population data with the superstore data build a view in Tableau that contains the state field. Figure 1 shows a view that will work.

 Automatically Defined Relationship 1

Figure.1 –  Automatically Defined Relationship 1

Superstore is the primary data source. The bar chart is filtered for the desired year. The population data is from a completely different data source, but both data sources include the word state. Automatic blending can now be done by pointing at the population data spreadsheet and dragging it into the worksheet seen in Figure 1. Once that is done, the data from the population spreadsheet can be used in the workbook.
Data visualization in Figure 2 uses the blended population data to express sales per hundred thousand population by state. Look at the data window in the upper left of Figure 2. The blue check next to the superstore data source indicates that it is the primary data source. The orange check next to the population data denotes it is the secondary data source. Since the secondary source is highlighted you see its dimension and measure fields below. The orange border on the left side of the dimension and measures shelves confirms that they come from the secondary data source and the orange link to the right of the state field indicates the field used for the blend. You can also see the state field in Figure 1 from the primary data source.
Warning—when you perform data blending you must ensure that all of the records you expected to blend actually came into the dataset. In Figure 2 that is clearly not the case. The states of Massachusetts (MA) and Missouri (MO) didn’t come over in the blend because the state names in the census data are not abbreviated. This can be fixed by right-clicking on the abbreviated state label for Missouri and Massachusetts and aliasing full spelling of each state name. After that is done, the population data from those states will be blended as well.
This is an important point with Tableau data blending. As the “designer” you must ensure the integrity of the data blend. The whole point in doing this exercise was to use the blended data to calculate per capita sales by state. Figure 3 displays the finished blend.
To save space, Figure 3 shows only the top seven states by per capita sales.
The labels to the right of each bar show the sales per hundred thousand people.
The color of each bar here denotes the total sales of each state for the given data.

Join DataFlair on Telegram
Automatically Defined Relationship 2

Figure.2 – Automatically Defined Relationship 2

Let’s revise Tableau Field Operations & Tableau Data Extract

b. Manual Data Blending in Tableau

What if your needs are more involved? A scenario that requires a more complicated blend would be the comparison of budget data from a spreadsheet with actual data from a database. Assume that you have defined a budget by product category for each month in the year 2012 and that you want to create a visualization that will display the actual and the budgeted sales by month.

Tableau Data Blending - Manual Blending

Figure 3 – Tableau Manual Blending

Building this view will require a blend of the product category and the date field. The steps required are:

  1. Connect to both data sources.
  2. Use the editing relationship mean to define the blend.
  3. Build the visualization.

The superstore dataset and the spreadsheet when joined have data containing budgeted sales, it is also possible to define the blend manually. Tableau data blending must include both the product category field and a date field. In this example, month and year are used. Figure 4 shows a bullet graph that uses the blended superstore data and budget data.
As you can see in Figure 4, actual sales data from the primary data source (the orders table in superstore) is displayed as blue or gray bars. For each cell budgeted data from the secondary data source is plotted via black reference lines which are vertical. Notice the two orange links in the dimension shelf for the budget data source. Both fields are being used in data blending. How do you create a more multi-field blend? Figure 4 shows the Edit Relationships menu for both data sources. Since the view contains sales data by month and year for the year 2012, the custom option must be used to select the date field. Figure 4 displays the sales by month and year. Clicking the Add button exposes the add/edit field mapping window where the specific data aggregation can be selected from each data source. Clicking the OK button creates the second link.

Figure.3 - Manual Blending

Figure.3 – Manual Blending

5.  Conclusion

In this tutorial, we are learned how to blend the data in Tableau, how to create Tableau Data blending, type of Tableau data blending and a few examples of data blending in Tableau to learn and understand these terms better.

See Also- Download Tableau & Book to learn Tableau

For reference

2 Responses

  1. Pavan says:

    Can you please provide links to the data sets that you have used in your demostrations

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.