# Sankey Charts & Flow Diagrams & Sigmoid Function in Tableau

Similar idea: Funnel Charts

http://www.tableau.com/learn/tutorials/on-demand/funnel-charts-0

Sankey Chart: Beginner Step-by-Step Guide

Solution1. Build Sankey Charts Based on Transformed Data

http://www.dataplusscience.com/RecreationinTableau2.html

Use one excel worksheet. Data transformation was completed in excel.

This viz shows the change of ranks for each state from 2012 to 2013.

Solution2. Build Sankey Charts By Joining Two Worksheets

http://www.dataplusscience.com/SankeyinTableau82.html

Use two excel worksheets. Data transformation was completed in Tableau directly, so the visualization can be updated with new data without redoing the charts.

This time, we create calculated fields for “sigmoid function” and “curve” in Tableau, instead of having them as variables in excel before import.

An example:

http://www.dataplusscience.com/RedesignEnergyBill.html

Solution3. Use Polygons to Simply the Viz

Notes:

1.

`- Create a "Top Step 1" set: right-click on "Step 1" pill / create a set and sort it using Top / By Field / Top / Top N Step 1 (parameter) / Size (indicator) / Sum`

Here size indicator is the variable named Visites

2.

The calculated field was named “Group Step 1” in author’s workbook:

```- Create an "Agg Step 1" dimension: this should be

IF [Top Step 1] THEN [Step 1] ELSE 'x Other' END```

Group Step 2:

`IF ISNULL([Step 2]) THEN 'x Sortie de site' ELSEIF [Top Step 2] THEN [Step 2] ELSE 'x Other' END`

Group Step 3:

`IF ISNULL([Step 3]) THEN 'x Sortie de Site' ELSEIF [Top Step 3] THEN [Step 3] ELSE 'x Other' END`

Decision Trees & Flow Diagrams:

Sankey Charts:

http://www.dataplusscience.com/RecreationinTableau2.html

http://www.theinformationlab.co.uk/2015/03/04/sankey-charts-in-tableau/

http://www.dataplusscience.com/TableauReferenceGuide/

https://www.concentra.co.uk/blog/how-to-build-sankey-chart-tableau

discussion

Make Sankey Charts with Alteryx

Tips

How to unhide headers: Right click the pill next to “Columns” or “Rows”, and select “Show header”.

How to create position1 & 2  in STATA: (suppose var1 is the variable on the left side, and var2 is the variable on the right side)

sort var1 var2

gen position1 = _n

sort var2 var1 position1

gen position2 = _n

* You need to add “position1” in the second sort command to get smooth lines. (If you don’t, you will get the right intervals, but the lines in each interval would be messy-style crossing each other.)

How to reduce white space:

For stacked bar charts (which will be placed to the left and right of the curve), simply use the size shelf to enlarge the size, and edit the y axis to have a fixed range from 0 to the largest number.

For the curve chart, set x axis to fixed -6 to 6, and y axis to fixed range.

—————-

Update08302016:

Given that it’s so complicated to create sankey charts with Tableau, it might be a good idea to consider alternative tools.

A tool to develop sankey diagrams directly: Fineo

Update11012016:

This is a blog with all kinds of sankey diagrams: http://www.sankey-diagrams.com/

There is also a page about the softwares: sankey diagram software