4 Replies Latest reply on Dec 7, 2016 3:11 PM by Neil Chakraborty

Need help on creating Sankey diagram

Hello,

I have a example data set where I am trying to show the number of students who overlap between programs on one side and Languages on the other filtered by year. I duplicated 49 rows for each original row - so t ranges from 6 to -6. Also created a count variable so that I can calculate the number of students for each program and languages and their overlap. Also, created a sigmoid function.

Not sure how to calculate the Rank1,  Rank2 and subsequent Curve calculated fields ( based on Sankey Charts in Tableau - The Information Lab ). Can somebody please suggest me what to do next.

Thanks,

Neil.

• 1. Re: Need help on creating Sankey diagram

Hey Neil,

Taking a quick look at the spreadsheet and workbook, I have a couple observations:

1. When you duplicated the data (as indicated in Step 1 in the blog post), I don't see where you created a field "RowType" that classifies the original data as "Real" and the duplicated data as "Dummy".
• This will be used to create the [ToPad] Measure as indicated at the beginning of Step 2 and will factor in on Step 5.
• Then, you'll create the [t] field within Tableau (instead of doing it within Excel).
2. I would recommend creating the [sigmoid] field within Tableau. I had issues getting the [Curve] formula to work because Tableau was requiring you to add ATTR() to [sigmoid]. So once [sigmoid] is created in Tableau, the [curve] formula will be: [Rank 1]+(([Rank 2] - [Rank 1])* [Sigmoid])

Once you get here, the rest of the instructions seem pretty straightforward. I didn't want to try messing with/duplicating your data since I'm not familiar with it, so try these couple of things and let me know how it works out.

Walt

• 2. Re: Need help on creating Sankey diagram

Thanks Walt. I still have the issue - I am trying to follow up on how to do it based on : Data + Science . Unfortunately, its been a tough road for me to mimic what Tableau developers have put up online.

I am still facing issues with the curve function when there is a count of cells involved. Basically, all I want is to show the number of overlap courses and languages. For example, the number of Anthropology students taking Chinese courses is only 8 across the years. I know there are more than manageable number of programs right now (about 40), but I can always aggregate those, once I have figured out a way to show the flow between courses and languages.

• 3. Re: Need help on creating Sankey diagram

Hey Neil,

I think I'm still unclear on how you prepped the data. Did you duplicate it (double it), or did you duplicate it 49x?

• 4. Re: Need help on creating Sankey diagram

Thanks Walt for the reply. As you rightly pointed out, I duplicated by 49x to give full range from -6 to 6.