7/9/2014
Utilizing Improved Information Connectivity in Tableau 8.2 to Construct Sankey Diagrams
Sankey diagram are actually even simpler with Tableau 8.2. It has been a number of months since my unique put up on constructing sankey diagrams in Tableau, however I proceed to get common emails with examples and questions. Immediately somebody emailed me with an fascinating query concerning constructing sankey diagrams in Tableau.
The query was:
« The process you describe on methods to do Sankey diagram requires the step to do knowledge transformation in Excel. Is there a method to try this knowledge transformation in Tableau instantly? The reason being that of scalability. If there are 10 Sankey visualizations, and when there’s new knowledge, you don’t need to manually replace the info and do the info transformation once more in Excel. »
So the problem is to take knowledge for the sankey and apply the transformation with out utilizing the Excel Macro or SQL code that I’ve posted beforehand. So can Tableau do that instantly?
The reply is sure. By utilizing the brand new and improved knowledge connectivity it’s attainable to form the info for the sankey diagram with no need to organize it in Excel or SQL forward of time.
The brand new knowledge connectivity interface permits the person to import two Excel sheets from the identical Workbook and apply varied joins. The primary worksheet has the Sankey Information (100 rows from my Vitality Sankey, 1 row for every 1%). The second worksheet within the workbook is the Sankey Mannequin. This might be the identical for each Sankey. It merely incorporates 49 rows with the worth of t going from -6 to six in .25 increments. I added a area in each worksheets known as « Hyperlink » and simply populated the phrase « hyperlink » in each sheets. Utilizing the default internal be part of this creates 4,900 rows. It’s because the « Hyperlink » area in each worksheets internal joins the 100 rows with the 49 rows to create the 4,900 rows which are wanted to plot the sankey. This eliminates the info shaping that was beforehand wanted. As soon as that is loaded in Tableau the formulation are principally the identical as my earlier directions here .
If you want to comply with alongside you possibly can obtain the info file here.
NOTE – this answer requires utilizing Tableau 8.2 (see 8.1 answer under)
From the preliminary Tableau display click on « Hook up with knowledge ».
Choose « Microsoft Excel » and select the file listed above to load into Tableau
There needs to be two worksheets listed, « Information » and « Mannequin ».
Drag « Information » to the info window.
Drag « Mannequin » to the info window
You’ll discover that by default the 2 worksheets are internal joined:
Click on « Go to Worksheet » after which comply with instructions to create the sankey diagram (up to date instructions under).
To create this visualization I exploit the Sigmoid Perform: S(t )=1/(1+e (-t ))
(extra info here.) In Tableau I exploit the operate EXP(1) for e.
We are going to use the next fields:
ID, Title, Curve and t
To get the form of the road I plot 49 factors, which was merely used to get sufficient factors to plot the form of the curves.
t = a price between -6 and 6 in .25 increments (which is 49 values)
Step 1: Create some calculated fields
Calculated Subject Title: Sigmoid Perform
System: 1/(1+EXP(1)^-[t])
Calculated Subject Title: Curve
System:
[Position 1] + (([Position 2]-[Position 1])*[Sigmoid Function])
Step 2: Construct the Viz
Transfer t to Columns
Proper click on and alter the sector to a dimension
Transfer Curve to Rows
Proper click on and alter the sector to a dimension
Transfer ID to Particulars
Transfer Title to Particulars
Set Marks to Line
Edit X-Axis to Fastened Begin and Finish in case you want room for labels)
Edit Y-Axis and Reverse Scale
Uncheck « Present Header » on Y-Axis and X-Axis
Transfer Title to Shade
Edit colour, transparency and measurement as desired
You need to now have a visualization that appears one thing like My Vitality Invoice Redesign here.
UPDATE 7/10/2014: Because of Tableau Zen Grasp Mark Jackson for offering this display shot for doing the internal be part of with out the brand new Tableau 8.2 interface.
I hope you discover this useful. If in case you have any questions be at liberty to e-mail me at Jeff@DataPlusScience.com
Jeffrey A. Shaffer
Comply with on Twitter @HighVizAbility