[Click here to find all my Sankey Chart series]

A colleague once asked me how to create a Sankey Funnel Chart a while ago. I told her to start with this multi-stage Sankey template. Then color the not-in-use branches the same as the background (to hide them). It worked but the process was a little messy.

Someone asked me again a few days ago and mentioned Ken Flerlage's post that she had some problem with. I decided to take a deep dive into Ken's approach. Here I come up with an easy template for creating Sankey Funnel Chart in Tableau. The development of this template is based on the prior contributions of Jeffrey Shaffer, Olivier Catherin and Ken Flerlage.

New in this template:

  • No extra data preparation is required.
  • The polygons are created via data densification. No need to join with scaffold table. 
  • All complex table calculations are hidden from the users of this template.
  • By replacing the data source, you will have your Sankey Funnel Chart.

Three Steps to Sankey Funnel Chart

Below are the three steps to creating a Sankey Funnel Chart via the template:
  1. Add your data source to the template workbook (Download it here). Union your data source with itself. When union may have problems (Found this issue in Tableau Desktop 2020.4), try checking "Use Data Interpreter" in the data source editor to fix.

    You can also union data in Custom SQL. See here for details.

  2. Create Step1/2/3/4/5 by renaming dimensions or creating new fields (See example below).
  3. Replace the template data source by your self-unioned data source. 
If you see something like this after replacing data source:
you need to manually sort the step dimensions in question to match the branches.

The above is using a 5-step funnel as an example. To create a 4-step funnel, just remove Step5 from the template dashboard.  In case of a 3-step funnel, remove both Step4 and Step5 from the template dashboard.

Let me show you an example below.

Funnel Data Model

First, the expected data source model for funnel visualization is as follows (borrowed from Ken's post). The key is that from Step3 and later, only one category of the prior step will have non-null data in the following step. Say, in Step4, only Qualified from Step3 is available as valid data.
The aggregated data table view in Tableau is as below:
For convenience, I am going to use the Superstore data source as my data source. First, I need to adapt it to be a funnel kind of data set as above, namely create dimensions like Step1, Step2, Step3, Step4 and Step5. For the only measure, I will use Quantity.

In 5 steps, we would like to create a funnel like All Records>Region='West'>Category='Technology'>
Segment='Home Office'>Ship Mode='Standard Class'. Then we created these calculated fields.
  • Step1 = 'All Records'
  • Step2 = [Region]
  • Step3 = IF [Step2]='West' THEN [Category] END
  • Step4 = IF [Step3]='Technology' THEN [Segment] END
  • Step5 = IF [Step4]='Home Office' THEN [Ship Mode] END
Depending on the data you have, you may need to organize your data like the above. Now it's time to replace the template data source by my reshaped data source. You may need to manually sort each step dimension to be in the desired order. Here is the resulting chart:
There you go. We just showed how to create a Superstore Sankey Funnel Chart via template. Give it a try with the template. Leave comments below if you have questions.

A wide version which is similar to Ken's viz is included here. It has a parameter which allows you to set each column to align to the top, or not.
Recently I got a request that asks for a vertical version of the funnel. Here you go with the template. If you need the mirror of the below, just Show Header of the columns. Then reverse the axis.

Caveats

Some reported issues as follows. 
1. After data source replacement, you may find a lot points of exclamation in red ! 
Solution: Locate Size(1). Right click it and select Replace References. Then a list pops up. Select Size. Voila.

2.The field Path has a ! To fix it, open it with the editor. If you see something like "Table Name 1", remove the 1. Keep only "Table Name". Done.
59

View comments

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