Using a Sankey Diagram in Customer Complaint Analysis
- Aleksandra Burczyk
- Feb 11
- 5 min read
A Sankey diagram (also called a flow diagram) is a special type of flow chart in which the width of the arrows is proportional to the size of the represented flow (e.g., number of complaints, cost of complaints). It provides a graphical representation of how different quantities are distributed across subsequent stages of a process.
What distinguishes a Sankey diagram is that it draws attention to the largest flows – the thicker the arrow, the greater the value of that flow. This makes it easy to identify the main sources of problems, bottlenecks, or losses in the system. Originally used in energy management and mass balance analysis, Sankey diagrams are now applied in various fields, including production processes and root cause analysis of complaints.
Advantages and Disadvantages of Sankey Diagrams
Advantages
Clear presentation of flows:The width of the arrows directly illustrates the magnitude of flows, making it easy to see which areas generate the most complaints or where the largest losses occur.
Visually appealing format:These diagrams are aesthetically attractive and engaging, which makes it easier to present complex processes to non-technical audiences.
Efficient use of space:A Sankey diagram can present a large amount of information in a relatively small area (unlike multiple bar charts).
Highlighting key elements:Colors or varying arrow thickness draw attention to the most important areas – you can immediately see where the largest flows or significant losses occur.
Disadvantages and Limitations
Complexity with many nodes:If the diagram contains too many nodes (categories) or flows, it can become cluttered and hard to read. It is recommended to group data or simplify the structure.
Unfamiliarity for beginners:People not familiar with this type of diagram may find it difficult to interpret and may require additional explanation or context.
Difficulty with similar values:If two flows have very similar widths, the difference may not be immediately noticeable. Careful selection of colors and appropriate scaling can help avoid misleading impressions.
Need for descriptions:A diagram without labels can be unclear. It is usually necessary to add a legend, title, and explanations so that the viewer understands what each node and arrow represents.
Sankey Diagram in Complaint Analysis
In the manufacturing industry, a Sankey diagram can support root cause analysis of customer complaints in various ways. For example, it can show how many complaints of specific types pass through different stages of the production process and what their root causes are.
This allows for quick identification of the main sources of problems – for instance, seeing that the majority of complaints related to paint defects (a bottleneck) result from improper material selection or operator error.
The diagram enables you to identify the beginning, middle, and end of each complaint flow “at a glance.” It helps determine whether a particular production stage generates an excessive number of complaints or which combination of complaint type → process stage → root cause occurs most frequently.
Similar diagrams are widely used to visualize material or cost flows in production systems.
Example Structure of Complaint Flows
When building a Sankey diagram for complaints, data is usually arranged in successive “layers” of categories. For example:
Complaint Type → Production Process → Root Cause
In this structure, each flow shows the number of complaints of a given type passing through a specific stage and resulting from a particular cause.
Example flows:
Paint defect ➔ Painting stage ➔ Incorrect pigment mixture
Mechanical damage ➔ Assembly ➔ Operator error (loose component)
Documentation inconsistency ➔ Quality control ➔ Outdated instruction
Missing part ➔ Warehousing ➔ Incorrect material order
Each such path (arrow) in the Sankey diagram will have a width corresponding to the number of complaints for that combination. Arrows originating from the “Complaint Type” stage connect to nodes representing specific processes and then lead further to root causes.
Preparing Data for a Sankey Diagram
To create a Sankey diagram, data must be prepared in the form of numerical flows. In practice, the following steps are usually taken:
Data collection:Export data from a complaint management system such as Ingenes Studio – Customer Complaints Module or from an ERP system. The dataset should contain at least the following columns: ComplaintType, ProductionProcess, and RootCause. Each record represents one complaint assigned to specific categories.
Aggregation:Sum the number of complaints for each unique path. For example, create a pivot table counting how many complaints correspond to each Complaint Type and Process. Then create another table for Process → Root Cause. The result should be a list of pairs (source → target) with their corresponding values.
Data format:A Sankey diagram typically requires three columns: Source, Target, Value. For the first layer (Type → Process), the source will be the complaint type name, the target – the process stage, and the value – the number of complaints. The same applies to the second layer (Process → Root Cause).
Category consistency:Ensure category names are consistent (e.g., do not use both “Assembly” and “Assy”). Consider grouping very rare causes into an “Other” category to simplify the diagram.
Verification of totals:After loading the data into the tool, check whether the sum of outgoing flows from the initial node (e.g., total number of complaints) matches expectations.
Properly prepared data ensures that the visualization accurately reflects the real process – otherwise, it may be misleading.
Tools for Creating Sankey Diagrams
Sankey diagrams can be created in many popular analytical and BI tools:
Ingenes Studio:Includes a dedicated dashboard module where data can be visualized in various chart types, automatically sourced from the system’s records.
Power BI:Microsoft’s platform offers a certified “Sankey Chart” visual. After loading the data, you can quickly build a Sankey diagram and benefit from interactive filtering and drill-down capabilities.
Tableau:Although Tableau does not have a native Sankey chart type, it can be created using data densification techniques or available extensions (e.g., scripts and add-ons from Tableau Exchange). Tableau also supports dynamic flow exploration.
Excel:Excel does not include a built-in Sankey chart, but add-ins and plugins (e.g., SankeyMATIC, ChartExpo) or layered chart techniques with Power Query can be used to build a similar diagram without coding.
Python:Several libraries support Sankey diagrams. For example, Plotly (go.Sankey function) enables interactive Sankey visualizations. Matplotlib includes the matplotlib.sankey module, and additional options are available in libraries such as holoviews or networkx with extensions. Python provides flexibility and automation capabilities.
Other tools:Similar functionality is available in tools such as Qlik, Power Query (in Power BI/Excel), or specialized web applications. The choice depends on the available environment and user preferences.
Example Sankey Chart

In this simplified diagram, each arrow band represents the magnitude of the flow between successive nodes: the thicker the arrow, the greater the value (e.g., more complaints). The same structure would be applied in complaint analysis: for example, the complaint type would appear on the left, followed by the production process stage, and then the root cause.
By using real data, it becomes possible to see which flow paths are the thickest—and therefore the most significant from a quality perspective. In this way, a Sankey diagram facilitates the identification of key areas requiring improvement within production processes.
Summary
A Sankey diagram is a valuable analytical tool in the manufacturing industry when there is a need to clearly visualize complex data flows, such as complaint pathways. It makes it easy to highlight the most significant sources of problems (the thickest flows), which can be more difficult with traditional charts.
Using a Sankey diagram in root cause analysis of complaints enables both a quick presentation of the situation to decision-makers and a more in-depth data analysis (e.g., with tools such as Power BI, Tableau, or Python libraries). Thanks to its advantages—when used carefully to avoid overloading the chart—a Sankey diagram can significantly enhance the process of continuous quality improvement in production.



Comments