Give a chestnut! Tableau Tips (7): how to make Pareto graph

published: 2021-05-31

Pareto chart is one of the seven basic quality tools of Japan's outstanding quality management master Ishikawa Shin.

Pareto diagrams use Pareto's law, often called the principle of twenty-eight, that is, 80% of the problems are caused by 20% of the reasons. In the Pareto diagram, two important information are reflected through the graph:

"Very important few" and "Insignificant majority".

As shown below: when the parameter is adjusted to 80%, the X axis is 21%, indicating that 80% of the company's sales are concentrated on 21% of products, so these 21% of products deserve our attention.

1.png

In this issue of "Take a Chestnut", the Tableau technique that Ada wants to share with you is: How to make a Pareto chart.

Step 1: data preparation

Import the data "Global Order". The data used in this example are "Sales" and "Product Name".

Step 2: Create a cumulative percentage chart

Create a calculation field "percent of total sales", as shown in the following figure, which represents the percentage of the total sales of all products before a product (from left to right according to the horizontal axis).

2.png

Drag and drop "Product Name" to the column function area, and drag and drop "Total Sales Percentage" to the row energy area. Select "Product Name" as the calculation basis. To display all product names, select the view as "Appropriate Width". As shown below:

3.png

Sort the "Product Name" and sort in "Descending" order by the "Total" value in the "Sales" field.

4.png

Select the "line" graph in the marker card to complete the cumulative percentage graph.

5.png

Step 3: Create a column chart

On the basis of the above picture, drag and drop "Sales" to the row ribbon, note that "Sales" is placed on the far left, adjust the "Sales" in the "Mark" card to a bar chart, click the field "Sales" "", Select "dual axis", then the two graphics will be merged according to the dual axis.

6.png

At this time, there are many product names on the horizontal axis. In order to better display the distribution, the horizontal axis is converted into a percentage form of "product name".

Create a calculation field "% product name" and calculation content "INDEX () / SIZE ()", indicating that the product before the product accounts for the percentage of all products.

Drag and drop "% product name" to the column function area, and drag and drop "product name" to the "All" tab on the "Mark" card, right-click "% product name", select "calculation basis" " product name". If there are other fields for calculation basis, also select "Product Name".

7.png

Step 4: Create dynamic parameters

The above picture completes the basic Pareto production. In order to quickly obtain information, it is necessary to create dynamic parameters.

Create the parameter "Total Sales Percentage Parameter" as a reference line for the vertical axis of the total sales percentage. The data type is "floating point", the format is "percentage", the minimum value is 0, the maximum value is 1, and the step size is 0.01. After clicking "OK", right-click on "Sale Percentage Parameters" and select "Display Parameter Control".

8.png

In order to let the intersection of the horizontal and vertical coordinate reference lines fall on the cumulative percentage graph, create a calculation field "horizontal axis reference line", the calculation content is

IF [total sales percentage] <= [total sales percentage parameter]

THEN [% product name ]

ELSE NULL END”

9.png

Add a reference line to the vertical axis of "Total Sales Percentage", the value is the percentage of total sales, the label is "Value", and set the color, line shape, etc.

10横轴.png

Add a reference line for the horizontal axis, the value is the "maximum value" of the "horizontal axis reference line", the label is "value", and set the color, line shape, etc. Here, pay attention to drag and drop the "horizontal axis reference line" to "All" in the mark card.

11纵轴.png

Finally, you can select "% product name" or "% of total sales" or "horizontal reference line" in "Measure", right-click and select "Number Format" in "Default Attributes", you can set it to "Percent", Set the number of decimal places to 0, so that the displayed number is displayed as a percentage.

12.png 

So, the Pareto diagram is complete, have you learned it ☻

1.png