“A Pareto chart, named after Vilfredo 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

General assumption in Pareto chart is that 80% of the output is generated by 20% of input. This ratio is not accurate for all cases but it is very much accurate for most.

Lets try making one using #makeovermonday data on http://www.makeovermonday.co.uk/data/ for week 8 i.e. where does your medicine come from?

Step 1: Import the excel file into Tableau, Filter the data with year = 2016 and put a filter to have all countries expect world for exporter field. Then, drag the Exporter field to columns shelf and exports (USD) into rows shelf in worksheet and sort the exporter field in descending order by Exports (USD)

Step 2: Click on sum of Exports (USD) and select quick table calculation –> running total to calculate the running total of the values

Now our Pareto chart is ready but still we haven’t figure out the 80:20 ratios on output to input:

Step 3: Now we have to change the Exports(USD) axis from running total to percentage of total. To do this, please right click on the Exports(USD) on row shelf and select edit table calculation option as shown below:

 

Step 4: Once edit table calculation opens, please perform following:

  • Change compute using from Table across to Specific Dimensions –> select Exporter field
  • Select the Add Secondary calculation option given and select the secondary calculation type as Percent of Total
  • Also, change the compute using from Table across to Specific Dimensions –> Exporter Field

 

Now in below image we can Sweden is in top 12 but Exports(USD) is already at 82%

Step 5: Right click on Y-axis and Add a reference line then set Line value at 0.8 (i.e. 80%)

Step 6: Now create a calculated field to get Exporters percentage using Index() and Size() function:

Step 7: Drag the new calculated field to column shelf and drag exporters column to details under Marks then select the chart type as Line graph and also change the axis format to % as shown below

Step 8: Add a reference line on X-Axis and set Line Value at 0.2 (i.e. 20%) as shown below

From below screenshot, we have successfully create Pareto chart in Tableau:

Tableau workbook can be downloaded from here

Thank you visiting my blog 🙂

Do subscribe to keep receiving updates and new learnings

This week’s #workoutwednesday was about creating radial chart with lines equally spaced on the percent of the year completed.

Requirements

  • Use sales for 2017.
  • The size of the dashboard 500px x 600px.
  • If you think of the segments as a clock, Week 1 should be at the 12:00 position.
  • The weeks should be evenly spaced based on the week number.
  • You’ll be using geometry. The minimum radius is 1. The maximum radius is 2.3. (Spoilers provide some math help.)
  • The space between the segments is .15.
  • Note the tooltips to get some assistance on your math.

Here is my radial chart using LOD functions and bit of trigonometry functions to generate chart:

Thanks 🙂

Do subscribe to blog for keep receiving updates

#Makeovermonday partnered with Equal Measures 2030 for week 10 as we approach International Women’s day. This week we will be seeing how good or bad policymakers for 5 different countries are and how much awareness they have with women welfare in the country.

Here is the original dashboard:

I started with playing around with the survey data and create dashboard in simplified way to understand the responses and how well policymakers know the state of women in their respective countries. The requirement and data was share on http://www.makeovermonday.co.uk/data/ for week 10.

Below is my dashboard for #makeovermonday:

Thanks!!
Do subscribe to keep receiving regular updates

In today’s blog, I will guide you through how to use sigmoid function and create an Sankey chart using Tableau. Sankey diagrams are specific type of flow diagram in which the width of the arrows is shown proportionally to the flow quantity. Sankey diagram put a visual emphasis on the major transfers or flows within a system.

Below is the illustration of how sankey diagram looks:

This chart has 3 components:

1- Country on left side in stack bar format

2- Flow diagram in center showing the flow

3- Players name on the right side in stack bar

This graph shows depicts the Cricket players and the country where they belong.

Below is the final output of my Sankey chart using Tableau:

Since we have fair idea of Sankey diagram and what it shows lets get going and learn how to make one:

Step 1:

In our example we will consider top 20 ranked ICC cricketers for One day internationals for 2016 and 2017. Import the excel file into Tableau (Below screenshot of data)

Step 2:

Once data is imported we need to define the number of points to draw a smooth sigmoid curve. We will now create a calculated field “Point” and assign 1 for 2016 records and 49 for 2017 records:

Step 3:

For sigmoid curve, the coordinate values should be in between -6 and +6. To generate that curve we will create following calculated fields which we will use to create the curve:

Index = index()

X = 0.25*[Index]-6.25

Sigmoid = 1/(1+EXP(-[X]))

Curve = WINDOW_MIN(IF FIRST()=0 THEN MIN([Rank]) END)+[Sigmoid]*[Change]

Step 4:

Next is to create a bins (padded) based on Point. This will create additional 47 points which we need to create the curve through data densification

Step 5:

Drag Padded into rows and right click –> select show missing values then drag padded to details and then drag index into details as well and make it compute using Padded and similarly drag X into columns and curve into Rows in the sheet then make them compute using padded for both X & Curve as shown in below screen shot:

After bit of formatting, the chart will look like this with sigmoid curve with 2016 vs 2017 rankings of top 20 ODI batsmen:

 

Our sigmoid curve for Sankey graph is ready. Now, our next step should be to create one worksheet with all the countries and other stack bar with names of the players. Then we can add all sheets in dashboard to get desired Sankey flow chart output.

you can find tableau workbook here

Thanks!!

Do subscribe to blog for getting regular updates 🙂