Troubleshooting Sankey diagrams
If you're having trouble creating a Sankey diagram, it could be because you have cyclical values in your data set.
The easiest way to create a Sankey diagram without errors is to ensure you have distinct values for each category. The categories you define are used in the From and To fields when you configure the visualization.
Let's look at this example data set:
Department | Budget (in thousands) | Type |
---|---|---|
Sales | 80 | HR |
Sales | 40 | IT |
Sales | 20 | Misc. |
Development | 120 | HR |
Development | 67 | IT |
Development | 30 | Misc. |
Support | 75 | HR |
Support | 45 | IT |
Support | 12 | Misc. |
HR | 72 | HR |
HR | 20 | IT |
HR | 10 | Misc. |
In this sample data set, we do not currently have distinct categories. We are using HR as a category in both the Department
column and the Type
column. If we try to create a Sankey diagram with these values, we'll get an error.
![Trying to configure a Sankey diagram with cyclical values results in this error: Data cannot have cycle between From and To values.](../../image/uuid-b220c5db-b6d4-60ef-f0a8-41fe1a8c8536.png)
We can fix this by using the HR value to a different value in one of the columns.
tool to change the![Use the Replace tool to change the HR value to Personnel in the Type column.](../../image/uuid-ca73c37d-a0f7-bf53-b298-418ca32e660f.png)
With this change, we can now successfully create a Sankey diagram.
![With distinct values, we can successfully configure a Sankey diagram. The configuration is: the From field is Department, the To field is Type, and the Value field is Budget.](../../image/uuid-a9564bd0-4b65-b9b2-c97a-6ba45078c9dc.png)