A recent question in Tableau Forum prompted me to write this piece.

Scaffolding is one of the lesser known techniques in Tableau because it's not officially documented. There is a video session on it by the omnipresent Zen Master Joe Mako. That's all I can find.

Data scaffolding is very often used to blend data of multiple sources, especially when one can't use the native blend function of Tableau. Specifically, when the elements in the blending dimension are mutually non-inclusive, and we want to include all the data, scaffolding is necessary. In other words, scaffolding makes full outer join possible in Tableau. It keeps all the data without loss when blending data.

The Problem
Assume we have two data tables. Each table shows a number of products and their sales from one of the two stores. The question is what is the total sales from both stores.

Some kind of blending is necessary. Custom SQL can be applied to union the data together. Sometimes, SQL may not be accessible. So here we assume SQL is not an option.

The native blending in Tableau works like left join or right join. Some rows of the secondary data source have to be dropped, if the index dimension elements can't find a match in the primary source's same dimension.

For example, if Table 1 is primary and Table 2 is secondary, only 2 rows of Table 2 will be blended with Table 1, because product d can't find a match in the primary.

If Table 2 is primary and Table 1 is secondary, only 2 rows of Table 1 will be blended with Table 2, because product a can't find a match in the primary.
Because of data loss, the regular blending is not going to cut it.

The Scaffold
Here comes the scaffolding technique. We need to build a table with a single column that includes all the possible products.
Then we will make Scaffold table as the primary and both Table 1 and Table 2 as secondaries. And let the secondaries blend with the primary. And we get the grand total of all the sales as shown in the table below.
Note that ZN() is needed because some data marks can be Null. ZN() will turn them into zero so that they can be added.

The key of scaffolding is to create a dimension that is the super set of that in either of both tables. This way during the blending, no data will be lost.

In case of dynamic data, the scaffold dimension needs to have a complete list of products.

So this is how scaffold works to blend data of multiple sources. The workbook for this example can be downloaded here.

PS. A search on scaffolding turns up a few more articles for your reference:
Joshua Milligan: GOOGLE ANALYTICS IN TABLEAU: BLENDING DATA FROM MULTIPLE ACCOUNTS
Jonathan Drummey: Tableau Data Blending, Sparse Data, Multiple Levels of Granularity, and Improvements in Version 8


4

View comments

(Refresh the page if you want to view the gif image multiple times. Or go to Tableau Public and click the button at the top-right corner.)

Jake and I collaborated on a dashboard. He told me that he learnt a way to create an in-place help page in Tableau. He first saw it at a conference somewhere and couldn't recall who the speaker was. So I am blogging here about it but the credit goes to somebody else. If anyone knows who the original creator is, leave a comment below.

The key idea is to float a semi transparent worksheet on top of the dashboard, where a help text box is strategically placed on top of each chart. This way, we can explain how to view each chart and what data points are important, etc. This worksheet is collapsible by a show/hide button. 

Below I would like to show how this worksheet can be constructed.

1. Sheet with a single data mark.

  • Double click the empty space in Marks panel and add two single quotes. Make the null pill a text label. This creates a single null mark.
  • Set the view as "Entire View"

2. Create an show/hide button

  • Go to the target dashboard
  • Drag a floating vertical container to the dashboard, making it cover all the area of interest.
  • Drag the Single Null Mark sheet and drop it into the above container. Hide the sheet title.
  • Create an open/close button for the container and place the button at the top-right corner.

3. Add annotations

  • Format the sheet background opacity as 70% in the layout manager             
  • Select area annotations and place them anywhere of interest. 
  • Write help text and format it to highlight important messages.  
  • The text can serve as functional guide and/or insight guide.

Here is an example. Feel free to download the workbook and explore. Click the "i" button at the top-right corner to view the in-place help. 

0

Add a comment

Blog Archive
Loading
Dynamic Views theme. Powered by Blogger. Report Abuse.