Data blending is when you blend data from multiple data sources on a single worksheet. The data is joined on common dimensions. Data Blending does not create row level joins and is not a way to add new dimensions or rows to your data.
Data blending should be used when you have related data in multiple data sources that you want to analyze together in a single view.
To integrate data, we must first add one of the common dimensions from the primary data source to the view.
For example, when blending Actual and Target sales data, the two data sources may have a Date field in common. The Date field must be used on the sheet. Then when we switch to the secondary data source in the Data window, Tableau automatically links fields that have the same name. If they don’t have the same name, we can define a custom relationship that creates the correct mapping between fields.
For each data source that is used on the sheet, a query is sent to the database and the results are processed. Then all the results are left joined on the common dimensions. The join is done on the member aliases of the common dimensions so if the underlying values aren’t an exact match, you can fix it up in Tableau.
In general, a good test to see whether data can be integrated smoothly is to drag the dimensions from the primary data source into a text table on one sheet. Then on another sheet, drag the same fields from the secondary data source into a text table. If the two tables match up, then the data is most likely going to blend correctly in Tableau.
1. Connect to your data and set up the data sources
2.Designate a primary data source
3. Designate a secondary data source
4. (Optional) Define or edit relationships
Connect to Sample – Superstore Sales (Excel) and build a view that shows Sales by Customer Segment and Product Category.
Select Data > Connect to Data and connect to the Sales Plan spreadsheet.
Drag the Sales Plan measure to the Level of Detail shelf.
Right-click the Sales axis and select Add Reference Line.
In the Reference Line dialog box, add a reference line that shows Sales Plan per cell. When finished, click OK.
The Worksheet is now pulling data from the secondary data source (Sales Plan) to show how actual sales compared to the forecasted sales.
* Data blending requires a primary data source and at least one secondary data source. When you designate a primary data source, it functions as the main table or main data source. Any subsequent data sources that you use on the sheet are treated as a secondary data source. Only columns from the secondary data source that have corresponding matches in the primary data source appear in the view.
* After designating primary and secondary data sources, you must define the common dimension or dimensions between the two data sources. This common dimension is called the linking field.
* If the date field in the primary and secondary data sources have the same name, Tableau creates the relationship between the two fields and shows a link icon ( ) next to the date field in the secondary data source when the field is in the view.
* If the two dimensions don’t have the same name, you can define a relationship that creates the correct mapping between the date fields in the primary and secondary data sources.
|Data Visualization and Dashboarding Fundamentals|
Free Demo for Corporate & Online Trainings.