Friday, January 16, 2015

Advanced Analysis – Pareto Charts (Step by Step Tutorial)

This article is part of the Advanced Analysis series of data visualization tutorials.

In this tutorial, we will be learning how to build Pareto charts. This tutorial uses the video demonstration of Pareto charts found here: Pareto Charts

A Pareto chart, named after Vilfred Pareto, is a type of chart that contains both bars and a line graph, where individual values are represented in descending order by bars, and the cumulative total is represented by the line [Wikipedia].

We will be using a Pareto chart to test the Pareto principle, also known as the 80-20 rule, which states that typically 80% of events come from 20% of the causes. This is very common in sales transactions, where 80% of the profits come from the top 20% of the customers. We will be using a packaged Tableau workbook pasted below for our analysis.

Download the data
Download the packaged Tableau workbook "Pareto Charts.twbx" and open the fileThe file is available herePareto Charts.twbx

Connect to the data
There are two data sources in the packaged workbook. Select the first data source labeled Sample - Superstore Sales English.











Build the first view
Now that you have your data source set up, begin building the view.

Step 1
In the Measures pane, double-click Sales.

Step 2
In the Dimensions pane, double-click Customer Name.

Step 3
Hover over the Sales axis in the view and select the sorting icon that appears to sort the customers in descending order of sales.



Step 4
Make the view fit the width of the screen by changing the Fit drop-down in the Toolbar section to be Entire View instead of Normal.









The view looks like this.




















Step 5
Change the aggregation on the Sales to be a running total by right-clicking the SUM(Sales) pill from Rows and selecting Quick Table Calculation > Running Total




Step 6.1
Add a second quick table calculation by right-clicking the SUM(Sales) > Edit Table Calculation...

Step 6.2
Check the "Perform a secondary calculation on the result." box.
For the "Secondary Type" drop-down, select Percent of Total

Step 6.3
For the "Running along" drop-down, select Customer Name.
For the "Summarize the values from" drop-down, select Customer Name. Click OK.




















The view looks like this.



Step 7.1
Right-click in the data window and select Create Calculated Field...




Step 7.2
In the "Name" textbox, type % of Customers
In the "Formula" box, type index()/size()

Step 8
Drag the % of Customers field onto the Columns shelf in front of the Customer Name pill.




Step 9
Drag the Customer Name pill off from the Columns shelf and onto the Detail shelf in the Marks card.




Step 10
Change the % of Customers pill to be computed using Customer Name by right-clicking the pill in the Columns shelf and selecting Compute using > Customer Name.

Step 11
Change the % of Customers pill to be computed using Customer Name by right-clicking the pill in the Columns shelf and selecting Compute using > Customer Name.




Step 12
Right-click the % of Customers axis and select Format...
Next to the "Numbers" drop-down, select Percentage. Set the number of decimal places to 0.




Step 13
Change the view-type from Automatic to Line by selecting the drop-down list in the Marks card and clicking on Line.








Step 14.1
To draw a reference line at the 20% mark, click the % of Customers axis and select Add a Reference Line, Band, or Box...

Step 14.2
Change the Value aggregation from Average to Constant using the drop-down list.
Set the constant at a value of 0.2.
Click OK.

Step 14.3
Change the Value aggregation to be a Constant.



Step 15
Add a constant reference line at the 80% mark for the % of Total Running Sum of Sales axis.

The final view looks like this.

1 comment:

  1. Thanks for this great share. This post is much helpful for us.Excellent Blog! This is very helpful for who wants to learn professional Education. Please keep Going. Here we found the detailed about the how to build Pareto charts step by step process in Tableau. Learn indepth detailed about Advanced chart types in Tableau.
    The advanced chart types in tableau

    ReplyDelete