7 Replies Latest reply on Nov 7, 2018 5:43 AM by Ken Flerlage

# Creating a destination map as a Sankey graph?

I have data like this:

Trip ID | Origin-Destination | Stop Name       | Card Type

1          | Origin                    | Central Station | Adult

1          | Destination            | North Station    | Adult

2          | Origin                    | Main Street       | Student

2          | Destination            | West Street      | Student

etc.

I've attached a sample data file.

What I would like to do is calculate the top 10 stops by origin by card type and calculate the top 10 stops by destination by card type.

Then I would like to create a Sankey graph with the left column the top 10 stops by origin, and on the left, the top 10 stops by destination.

Each line of the Sankey should be colored based on card type (eg. blue for adult, green for student).

I've managed to get a Sankey done following this tutorial but I can't seem to be able to get it to show the data I want (that is, going from top 10 stops by origin to top 10 stops by destination).

Any help would be greatly appreciated.

• ###### 1. Re: Creating a destination map as a Sankey graph?

If you have some ability to restructure your data, you could use the sankey template here: Chart Templates Part 1: Sankeys - Ken Flerlage: Analytics Architecture, Strategy, & Visualization

• ###### 2. Re: Creating a destination map as a Sankey graph?

Thank you. Through your link I found this tutorial which was very helpful.

However it's not quite what I want. Following the tutorial allowed me to get Stop names on each side of the Sankey diagram, but the color is by stop name. I would like to add card type as marks and have the color by card type.

What happens at the moment if I add card type as a mark is that the entire Sankey disappears. If I add it as a color, then I get errors in my calculations.

1 of 1 people found this helpful
• ###### 3. Re: Creating a destination map as a Sankey graph?

Can you attach a workbook?

• ###### 4. Re: Creating a destination map as a Sankey graph?

I attached a sample workbook.

I managed to get the colors working (at least I think) but the problem is if I add a filter by card type, the Sankey graph will disappear unless I either have "Concession" or "Free Travel" checked.

• ###### 5. Re: Creating a destination map as a Sankey graph?

I think you may have a bigger problem. Your polygons seem to be overlapping. I'd suggest you go back and check your calculated fields and table calcs.

• ###### 6. Re: Creating a destination map as a Sankey graph?

I checked the fields again. The error is with the "Chosen Measure" dimension. The calculation should just be [Card Typ Cd].

Do you need me to attach a new workbook?

Edit: This is rather strange but as I was preparing a new workbook to attach, I changed the data source to a csv file with only a few hundred records (the original one has many thousands), but the fields start overlapping when I do that.

• ###### 7. Re: Creating a destination map as a Sankey graph?

Card Typ Cd isn't in the workbook...