Was this page helpful?
Yes No

Bring a Field into the Primary Data Source

Data blending is a method for combining data. Data blending works by supplementing the data in the primary data source with the data in the secondary data source.

In cases where you might only need just some of the data in the secondary data source, you can create a primary group to bring only the fields that you need into the primary data source. This eliminates the need for the secondary data source, which reduces the size of the workbook and can improve workbook performance.

For example, suppose you have two data sources: Superstore and Population. The Superstore data source contains lots of data, but most importantly, it contains data about states and the region each of the states is associated with. The Population data source contains state and population data, but doesn't contain any data about regions. In this case, you can blend the Population and Superstore data sources to create a primary group. Then so that you can pull in the Region field from the Superstore data source into the Population data source, thereby eliminating the need for the Superstore data source all together.

To blend two data sources and create a primary group

  1. Download and open the following workbook from Tableau Public.
    1. Go to https://public.tableau.com/profile/tableau.docs.team#!/vizhome/BringaFieldintothePrimaryDataSource/Sheet1.

    2. Click Download Workbook in the upper-right corner and then open the workbook.

    In the workbook, the State dimension is already on the Rows shelf, making it the first field in the view and establishing the Population data source as the primary data source for the sheet. The Superstore data source is also included in the workbook and functions as the secondary data source.

  2. In the Data pane, select Superstore, and then drag the Region dimension to the Rows shelf and place it in front of State.

    The view shows the regions from the Superstore data source (secondary) and the states in the Population data source (primary) that are associated with those regions. There are two states, Alaska and Hawaii, from Population data source (primary) that are not associated with a specific region. These two states are assigned to a "null" region.

  3. Right-click the Region field in the Rows shelf from the Superstore data source (secondary), and select Create Primary Group.

  4. In the Edit Group dialog box, drag Alaska and Hawaii (from the "null" region) to the West region. This task assigns the states in the Population data source (primary) in the "null" region into a region.

  5. Click OK to close the Edit Group dialog box.

  6. In the Data pane, select the State data source (secondary). Now you see a new group field listed in the Population data source (primary) called State (group).

  7. Drag the State (group) dimension over the Region dimension on the Rows shelf to replace it.

  8. Drag the 2016 Population measure to the Columns shelf to see Population based on the regions from the Superstore (secondary) data source.

  9. (Optional) You can close the Superstore data source (secondary), and then continue with your analysis. You can also publish the data source or workbook without the secondary data source. This is because the field you were using from the secondary data source, Region, is replaced by the primary group field that you created in the primary data source.

To watch a video that demonstrates another example of the Create a Primary Group functionality, see Cleaning Data by Bulk Re-Aliasing.