Building a sankey chart

by Heinrich Preuß

In our first external client project, we worked with a company that provides heating, cooling and electricity for facilities. We were asked by the client to create a Sankey diagram showing the energy (in kWh) flowing through the building.


Creating a Sankey diagram from scratch is very complicated and even Tableau visionary Andy Kriebel never did it himself, as he mentions in the following video where Klaus Schulte shows how to create a Sankey diagram with a template, which is much more efficient: https://web.microsoftstream.com/video/8e404c15-384d-4519-ba64-b324a4ce562f


Now in our customer project we had the problem that the different bars in the Sankey diagram (we chose the multi-level Sankey diagram because there was a hierarchy with three levels) were not represented by three different columns in the dataset, but they were all in one column, of course with sometimes duplicate values. We had two approaches to this problem with two different Sankey diagrams, each with different advantages and disadvantages.


What was certain was that we had to make three columns out of the one column we had before. The solution was to filter out the columns at the higher levels and use only the values at the lowest level. Then we assigned the corresponding upper level names to the lower level values according to a scheme we had received from the customer. In the end, this was a compromise that lost a lot of important data, but we were able to create a Sankey diagram that the customer was happy with.


Analyzing and partially solving these problems helped us a lot in understanding the requirements for creating a Sankey diagram with a Tableau Public template. Now I feel confident in using this type of diagram and can't wait for the next opportunity to create one. Here you can see the result on my Tableau Public site with Mock Data: https://public.tableau.com/app/profile/heinrich.preu./viz/SankeyFinal_16597087096800/Sankey

Tue 12 Jul 2022

Tue 05 Jul 2022

Mon 13 Jun 2022