8/27/2015
Tableau Think Data Thursday

### Tableau Think Data Thursday Video Library

"I didn't know that was Tablossible"
Presented by Noah Salvaterra, Chris DeMartini and Jeffrey Shaffer

Sample Workbook

### Sankey and Sankey-Style Slopegraphs

To create these visualization I use the Sigmoid Function: S(t )=1/(1+e (-t ))

In Tableau I use the function EXP(1) for e. So we need the create the input variable t. Therefore we need 4 fields.

Some Dimension (Name, Category, State, etc), Position 1 (ranking), Position 2 (ranking), t

To get the shape of the line I am going to plot 49 points for each Category (49 was simply used to get enough points to plot the shape of the curves and is the same number of values in t ).
t = a value between -6 and 6 in .25 increments (which is 49 values)

The data file example is here so you can download and follow along in Tableau with these instructions (Source: Times Higher Education).

Step 1: Open Tableau and Import Data

Step 2: Create some calculated fields

Calculated Field Name: Sigmoid Function
Formula: 1/(1+EXP(1)^-[t])

Calculated Field Name: Curve
Formula:

[Position 1] + (([Position 2]-[Position 1])*[Sigmoid Function])

Calculated Field Name: Color (optional)
Formula:
IF [Curve] <10.5 then 1
ELSEIF [Curve] <20.5 then 2
ELSEIF [Curve] <30.5 then 3
ELSEIF [Curve] <40.5 then 4
ELSE 5 END

Calculated Field Name: Size (optional)
Formula: ABS([Position 2]-[Position 1])

Step 3: Build the Viz

Move t to Columns
Move Curve to Rows
Move Name to Details
Set Marks to Line
Edit X-Axis to Fixed with Start = -10 and End = 10 (the extra space allows room for the labels - adjust as necessary)
Edit Y-Axis and Reverse Scale
Move Size to Size
Move Color to Color
Edit Color using Stepped Color with 5 Steps
Uncheck "Show Header" on Y-Axis and X-Axis
Move Name to Label
Select Left most points (at X = -6) and Select "Always Show" under Marks Label
Repeat for Right most points (at X = 6)
Format Curve to Number Format with 0 decimals
Move Curve to Label
Format Label to "<SUM(Curve)>. <Name>"
Format Sheet Lines to remove Gridlines and Zero Line (set to "None")
Format Sheet Borders to remove border (Row Divider and Column Divider Pane to "None")
Format Font Style/Color and Viz Spacing as needed

Click Color on the sheet and set "Markers" to "None". This will remove the dots at the end points.

### The progression in time:

Recreating State of America Rankings (Sankey-Style Slopegraph)
How-to Build State of America Rankings
Creating Multiple Charts
Redesign of My Energy Bill (Sankey)
How-to Build the Energy Bill Chart
Recreating a Financial Sankey in Tableau
Creating a Sankey using Polygons (by Olivier Catherin)
Tableau Community Thread on Polygon Sankeys
Sankey Charts Using Data Densification (by Chris Love)
Decision Trees, Flow Diagrams and Sankeys (by Olivier Catherin)

### Examples in practice:

Music Major ~ Data Miner (by Jeffrey Shaffer)
Path to the Draft (by Matt Chambers)
Top Music Artists in the UK & US (by Adam McCann)
The History of the Football League (by Chris Love)

### Other Chart Types

Weighted Fishbone Diagram
Venn Diagram
Arc Chart by Asher Campbell

I hope you find this helpful. If you have any questions feel free to email me at Jeff@DataPlusScience.com

Jeffrey A. Shaffer