A Graph Recreation in Tableau – Half 2: How To Construct
I obtained various pings about yesterday’s publish displaying the sankey-style slopegraph in Tableau (here). Listed here are the fundamentals of the recreation utilizing calculations in Tableau to simplify the method even additional.
Unique graph is here.
INSTRUCTIONS UPDATED 4/4/2014- Because of Tableau Zen Grasp Jonathan Drummey for declaring that the beforehand used Xval subject isn’t wanted. It is now merely changed with t.
To create this visualization I exploit the Sigmoid Operate: S(t )=1/(1+e (-t ))
(extra data here.)
In Tableau I exploit the operate EXP(1) for e. So we want the enter variable t. Subsequently we want 4 fields.
State, 2012 Rating, 2013 Rating, t
To get the form of the road I’m going to plot 49 factors for every state (49 was merely used to get sufficient factors to plot the form of the curves and is identical variety of values in t ).
t = a worth between -6 and 6 in .25 increments (which is 49 values)
The info file is out there here so you may load and observe alongside in Tableau. There are 3 further fields within the Excel file to point out the calculations, however they aren’t wanted in Tableau.
Step 1: Open Tableau and Import Information
Step 2: Create some calculated fields
Calculated Area Identify: Sigmoid Operate
Calculated Area Identify: Curve
System: [2012 Ranking] + (([2013 Ranking]-[2012 Ranking])*[Sigmoid Function])
NOTE: System Up to date 4/8/2014- Because of Catherine Rivier for providing a way more elegant resolution than the unique system.
Calculated Area Identify: Colour
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 Area Identify: Measurement
System: ABS([2013 Ranking]-[2012 Ranking])
Step 3: Construct the Viz
Transfer t to Columns
Transfer Curve to Rows
Transfer State to Particulars
Transfer t to Particulars and Convert to Dimension
Set Marks to Line
Edit X-Axis to Fastened with Begin = -6.5 and Finish = 6.5 (the additional .5 permits room for the labels)
Edit Y-Axis and Reverse Scale
Transfer Measurement to Measurement
Transfer Colour to Colour
Edit Colour utilizing Stepped Colour with 5 Steps
Uncheck « Present Header » on Y-Axis and X-Axis
Transfer State to Label
Choose Left most factors (at X = -6) and Choose « At all times Present » below Marks Label
Repeat for Proper most factors (at X = 6)
Format Curve to Quantity Format with 0 decimals
Transfer Curve to Label
Format Label to « <SUM(Curve)>. <State> »
Format Sheet Traces to take away Gridlines and Zero Line (set to « None »)
Format Sheet Borders to take away border (Row Divider and Column Divider Pane to « None »)
Format Font Model/Colour and Viz Spacing as wanted
Click on Colour on the sheet and set « Markers » to « None ». This may take away the dots on the finish factors.
It’s best to now have a visualization that appears like the instance. Use ColorPic (free coloration software) to get the colours excellent and import into the Tableau Choice file utilizing sort= »ordered-sequential » for this categorical coloration scheme.
I hope you discover this beneficial. You probably have any questions be at liberty to electronic mail me at Jeff@DataPlusScience.com
Jeffrey A. Shaffer
Observe on Twitter @HighVizAbility