Blends – Building and Integrating Data Pipelines

Data blends are useful in the case of data sources that have a limited relationship to each other and are used together for only some parts of the analysis and are kept separate for the remainder.

To blend a data source, follow these steps:

  1. Add a data object to the main area.
  2. Go to your visualization sheet.
  3. Click on the Data menu at the top of your screen, as shown in Figure 3.23.

Figure 3.23: Accessing the Data menu in Tableau

  1. Click on New Data Source.
  2. Select the desired data source type and follow the prompts. For this example, we have chosen the Salesforce Superstore data, as shown in Figure 3.24:

Figure 3.24: Adding a new data source in Tableau

  1. You will now see two different data sources in the top left corner of your data menu, as shown in Figure 3.25:

Figure 3.25: Two different data sources are visible after adding a new one

It is now time to define how the data sources should be blended. In order to do so:

  1. Click on the Data menu at the top of your screen.
  2. Click on Edit Blend Relationships. A menu will now open, as shown in Figure 3.26:

Figure 3.26: Editing blend relationships in Tableau

  1. In the menu, select which of your data sources should be the primary one. A good rule of thumb is the data source from which you will be taking the most fields, as shown in Figure 3.27:

Figure 3.27: Selecting the primary data source for a blend in Tableau

  1. Below the primary data source selector, you will see a list of fields.
    Tableau will try to populate those whenever possible. However, if these fields are incorrect or missing, you can adjust them by following these steps, as shown in Figure 3.28:

Figure 3.28: Defining relationships between fields in a Tableau data blend

  1. Select Custom from the Automatic/Custom selector.
  2. Click on a field (if present).
  3. Choose one of the options in the menu at the bottom:
    • Add: To establish a relationship between two fields.
    • Edit: To edit the relationship between two fields.
    • Remove: To remove the relationship between two fields.
  4. Clicking on any of these options will open a menu from where you can pick a field from the primary data source list and its counterpart in the secondary data source field
  5. In this case, we have added the Billing State/Province from Salesforce and matched it with State/Province in the Salesforce data. We have also kept the Segment to Segment match, as shown in Figure 3.29:

Figure 3.29: Mapping fields between two data sources to create a Tableau data blend

  1. Click on OK.
  2. If your blend is successful, you will notice the following changes:
    • Your primary data source has a blue tick next to its name.
    • Your secondary data source has an orange tick to its name, as shown in

Figure 3.30: Indicators of a successful Tableau data blend

  • The field(s) used for the blend have a chain icon next to their name.

You can turn the blend on and off by clicking the chain icon. Two linked chain rings indicate that the blend is currently active, and a barred chain icon indicates a currently inactive blend, as shown in Figure 3.31:

Figure 3.31: Chained versus barred chain icons indicating blend status

Troubleshooting tip

If you cannot see the changes, start dragging fields into the main visualization area. Tableau will treat the data source containing the first field you will use in the visualization as the primary one. For example, here, we have started by dragging the Industry field from the Salesforce data and only afterward added the Segment field from Superstore. So now you can see a blue tick next to Salesforce, as shown in Figure 3.32:

Figure 3.32: Tableau interpreting the first visualized field’s data source as primary in a blend

In this case, we started with the Superstore data and dragged Salesforce data afterward. The blue tick is now on the Superstore data, and the orange is on Salesforce, as shown in Figure 3.33:

Figure 3.33: Tableau interpreting the first visualized field’s data source as primary in a blend1

Blends work regardless of the data source type, as you can see in this case, where the Salesforce data is being blended with the standard Tableau Superstore data, which comes as an Excel .xls file. They are a good solution when dealing with different data types, as in this case, but can quickly encounter performance issues.

Joins– Building and Integrating Data Pipelines

Tableau makes it easy to join different tables by working out whenever it can on which fields the tables should be joined.

To start joining tables, follow these steps:

  1. Drag a table from the left side of the screen.
  2. Double-click on the table name, and a small menu will open.
  3. Drag the second table you wish to join.
  4. If Tableau has enough information, it will automatically select an inner join on all the fields found in both tables. If this is correct, you do not need to make any changes.
  5. If Tableau cannot find a link, it will highlight the problem with an empty Venn Diagram and a red exclamation mark, as shown in Figure 3.15:

Figure 3.15: Tableau indicating it cannot automatically join two tables

  1. In the cases where Tableau cannot automatically join the tables or if the default option is not the one you need, please follow the steps below:
    a. Click on the join icon to open the join menu. From here, you can select the following options:
    • The field on the left side table to use in the join.
    • The type of join, which can be an inner join, a left outer join, a right outer join, or a full join. These kinds of join work exactly as they would in SQL.
    • The field in the right-side table to use in the join.
    • A calculated field can also be used in a join. To create one, click on “Create Join Calculation” and proceed to create the field you need. More information on calculated fields will come in a separate section.

In the case below shown in Figure 3.16, the join is configured so that Tableau can use the table Account with the table Contact by using the field Account ID present in both tables but labeled as Account ID (Contact) in the Contact table.

Figure 3.16: Manually defining the join in Tableau using the join menu

As you can see, the red exclamation mark has disappeared and the two tables are now joined. This process can be repeated on as many objects as necessary. Simply drag any additional table into the join area, as shown in Figure 3.17, and proceed with the steps defined above.

Figure 3.17: Multiple tables successfully joined in Tableau

To remove a table, follow these steps:

  1. Hover on the table name
  2. Click on the caret on the left side of the table name. A menu will open, as shown in Figure 3.18:

Figure 3.18: Removing a table from the join in Tableau

  • Click on Remove.

The table has now been removed from the join. You can see that the number of tables in Account has changed from 2 to 1, as shown in Figure 3.19:

Figure 3.19: The join table count is decreasing after removing a table