Visualizing Air Crashes History in Tableau

In this article we are going to visualize the history of air crashes that have happened between years 1993 to March of 2015. The data have been sourced from here. The data excludes small planes carrying less than 6 passengers and non-commercial aircrafts such as cargo, military and private.

Data

The sourced data is in MS Excel file format and contains handful of columns such as date on which air crash happened, country in which it happened, the airline, fatality count, cause of the crash and phase of the flight during which crash occurred. Let us have a look at the dimensions and measures that needs to be understood in order to create different visualizations from this dataset.

The below table doesn’t contain all the columns available in the data source but only those which are meaningful from visualization creation perspective.

Dimensions Measures
Date Fatality Count
Location  
Country  
Airline  
Phase  
Certainty  
Cause  
Cause Details  

Data Exploration & Visualization

Step 1 – Connect to the data.

This is the preview of the data source that we have connected to. As can be seen all the dimensions and measures that we described in the above section are available in the data source.

Ignore the Tableau data interpreter warning.

Uploading air crash data for visualization

Step 2 – Go to Sheet 1 and analyse/review the loaded data.

Data  calibration for visualization

Step 3 – Fatality Count on Map

From this step onwards we will slice and dice the data and create different views of the data and at the same time create different visualizations to understand the data better and to derive insights from the same.

Double click on Country and put sum of Fatality count on colour and label. The colour palette can be chosen as per your own wish and you can play around with the advanced setting of the colour palette to suit your needs. Here is how the visualization looks like and it can be seen that majority of the fatalities have happened in USA followed by Russia, Iran, India and China.

World map for air crashes since 1993

There are some locations which you will need to correct manually as shown below and some due to lack of details can’t be corrected hence I have left them as Unknown.

Editing data on tableau

You can rename the sheet as Fatality by Country

Step 4 – Fatality by Airline

This is yet another interesting question to be asked which airline company has seen lot of fatalities. We will create a tree map for this analysis and filter the airline which has seen more than 100 fatalities in total.

Visualization of fatality by airline for air crashes

As can be seen this analysis falls in line with the analysis done in step above. American Airlines and United Airlines both operate out of USA which has seen the most number of fatalities. It will be interesting to see the cause of fatalities happening in Russia, my guess is it will be mostly due to en route issues.

Step 5 – Fatality trend over time

To create this line chart put Date on column and count of Fatality on row. As can be seen fatalities have decreased over time with the only exception of 2011 where incident of 9/11 happened. This shows that we are learning from our past mistakes and are trying hard to avoid fatalities. It will be interesting to see the variation in causes in 1993 versus recent years.

Determining fatality trend

Step 6 – Fatality Cause trend over time

To create this visualization put Date on column and Cause and Count of Fatality on rows.  As expected, fatality due to human error and mechanical failure has decreased over time in general.

determining fatality trend since 1993

Step 7 – Fatality by phase

To create this visualization put Phase on column and Count of Fatality on rows. 

You will see lot of different phases meaning the same, e.g. take off, takeoff, initial takeoff and initial_climb all are same hence i have grouped them together in Take off. Groups are shown as below.

Editing on tableau

Now use this group created on phase instead of Phase to create the visual. As can be seen 48% of fatalities have happened during landing and other 36% while flight is en route. It will be interesting to see what causes are impacting the fatalities during this phases.

Fatality by phase of the flight in visualizing historical air crashes

Step 8 – Cause vs. Phase analysis

To create this visualization put Cause on column and Phase group created in above step on row. Put count of Fatality on Size as well as Label (as quick table calculation – percent of total).

As can be seen below, during landing phase human error is the major cause of fatality followed by weather. Human error is also the main cause of fatality happening while flight is en route. Same goes for fatalities happening while take off.

Comparing cause vs phase for historical air crashes

Step 9 – Cause of fatality by year

Another interesting visualization could be to see the % of fatality by cause for each year. For this we can put Date on row and Count of fatality on column and cause on colour. Count of Fatality should be a table calculation calculated using table across.

As can be seen for all the years human error is the leading factor for fatalities happening.

Visualization  of historical air crashes

That is it for this time; stay tuned for more learning with Tableau.

About Tableau

Tableau (NYSEDATA) headquartered in Seattle, Washington has a mission to help people see and understand data. It offers a product portfolio for data visualization focused on business intelligence.

One can visit the official Tableau website to find more details about Tableau and its product offering and features.

Top N analysis with Tableau

Every dashboard or chart created needs to support one common business question which is “What are the Top (or bottom)
N (replace N with 5, 10 etc.)
Products (it can be anything Geo, Channel, Customers etc.)
by Revenue (it can be anything Profit, Margin % etc.)?”
In this blog, we are going understand how to answer this question with the help of filters and parameters.

In this blog we will use cricket data to understand how to do Top N analysis with the help of filters and parameters. In the process we will also understand what a context filter is.

Data

The data can be sourced from howstat.com and formatted appropriately for Tableau’s consumption. This is the first important and often time-consuming step before data visualization and exploration can happen. We have batting data for One Day International (ODI) matches played between years 1971 to 2011 with close to 60,000 data points. The below table gives you a quick overview of important dimensions and measures present in the dataset.

Dimensions Measures
Country Runs
Player name Score Rate (runs per 100 balls faced)
Opponent country  
Ground  
Match Date  

Data Exploration & Visualization

For this article our analysis is going to be around who are the Top N batsmen in terms of run scored.

Step 1 – Connect to the data.

connecting data to tableau

Step 2 – Go to Sheet 1 and analyse/review the loaded data.

reviewing data

Step 3 – Place Players on Row shelf

placing values  in row shelf in tableau

Step 4 – Place Runs with aggregation method as SUM on column shelf

placing values  in column shelf in tableau

 Step 5 – Sort on Runs

sorting values  in tableau

Now this is the crudest way of getting the list of Top N list of players who have scored the highest runs. The problem with this approach is that one sees all the players in the visualization and how one can restrict the visualization to show just top 5 or 10 or 20 players who have scored the most runs.

Step 6 – Put Filter on Player

Filtering data  in tableau


Filtering data  in tableau

Apply Top Filter on Player by Field Runs with aggregation method as Sum as shown above to get top 10 players by sum or runs.

The result of applying filter is as shown below with list of Top 10 players who have scored the most runs. As one can see Sachin Tendulkar tops the chart with no marks for guessing followed by Ricky Ponting, Jaysuriya and so on. Please note that this ranking is based on data of matches played till 2011. We have partially achieved what we wanted to do in terms of Top N analysis. How do one can make N vary and give the control of changing in the hands of a user. Let us say if one wants to find the list of Top 5 or 10 or 20 players by runs then the mechanism available in Tableau is to resort to parameter.

top N analysis  in tableau

Step 7 – Create a parameter

creating  parameters in tableau

Create a parameter of type integer as shown above and choose to show it. Note that the changing the value of parameter on top right (as shown below) will not have any impact on visualization as yet.

creating  parameters in tableau

 Step 8 – Use parameter in Filter

using parameter  in filter in tableau

Choose the parameter (Top N Input) that we created in above step in the filter as shown in the image above. Note that we could have created a parameter from the option provided in this dialog box.

Step 9 – See the parameter in action

parameters in  tableau

Changing the parameter value in slider will now change the visualization to reflect top N players by runs where N is determined by user selection through parameter control.

Step 10 – Put Country in Filter

filtering data  in tableau

Let us say we are interested in finding out Top N Indian Players by runs so put Country on Filter and select India as shown above.

After applying Country filter if one looks at the visualization (below) it just shows Sachin Tendulkar whereas parameter is set to 5. That is the visualization should have shown top 5 player of India who have scored the most runs.

filtering data  in tableau

Step 11 – Add Country Filter to context

filtering data  in tableau

The result of applying country as context filter now correctly produces visualization to show Top 5 batsmen of India by runs.

Top N analysis  in Tableau

A context filter is applied to the data source first, and then the other filters are applied only to the resulting records.

So take away from this blog are as below

  • Using Filter’s Top/Bottom condition by field and aggregation method
  • Using Parameter with Filter
  • Using Context Filters

That is it for this time; stay tuned for more learning with Tableau.

About Tableau

Tableau (NYSEDATA) headquartered in Seattle, Washington has a mission to help people see and understand data. It offers a product portfolio for data visualization focused on business intelligence.

One can visit the official Tableau website to find more details about Tableau and its product offering and features.

Creating square Choropleth map in Tableau

In this article, we are going to create a different type of Choropleth map which has become very popular nowadays. Various organizations especially the one into data journalism such as FiveThirtyEight, Bloomberg, The Guardian, The Washington Post and The New York Times has used it heavily off late. One such example from FiveThirtyEight is shown below.

choropleth map

In this blog, we are going to create a square Choropleth map as shown above.

As per Wikipedia definition of Choropleth map; “A choropleth map is a thematic map in which areas are shaded or patterned in proportion to the measurement of the statistical variable being displayed on the map, such as population density or per-capita income. The choropleth map provides an easy way to visualize how a measurement varies across a geographic area or it shows the level of variability within a region.”

This article from NPR visuals team provides a very good explanation of different type of Choropleth maps such as geographic, square and hexagon maps along with their pros and cons and is a very informative article to understand the thought process behind the emergence of this new type of Choropleth map.

Below is an image from the same article mentioned above which depicts the three different types of Choropleth map visualizing the same underlying data. In Square or Hexagon tile grid map every state (of USA in this case) gets the equal share of real estate irrespective of their geographical boundaries or shape as opposed to geographic choropleth map.

choropleth map

Data

This exercise requires data preparation as this type of chart is not readily available in Tableau. To come up with square choropleth map with equal weightage given to each state of USA we need to establish their co-ordinates to be plotted on the visualization. For this we need to assign the row number and column number to each state of USA with Alaska getting row and column number as 1 and Hawaii getting row number as 8 and column number as 1, so on and so forth.

Let us have a look at the dimensions and measures that needs to be prepared in order to create this visualization.

Dimensions Measures
State Abbreviation Profit
State Name Default Size
Row  
Column  

Row and Column determines where a particular state is to be positioned on the visualization. Profit is a random metric that we will visualize on the map. Default size will be used to create equally sized square shape for each of the state of USA.
This article has been referenced in order to create square grid tile map in this blog post.

Data Exploration & Visualization

Step 1 – Connect to the data.

This is the preview of the data source that we have connected to. As can be seen all the dimensions and measures that we described in the above section are available in the data source.

connecting data in tableau

Step 2 – Go to Sheet 1 and analyse/review the loaded data.

analysing data in tableau

Step 3 – Place Row on Row shelf

Tableau  tutorial

Step 4 – Place Column on column shelf

Tableau  tutorial

Step 5 – Put State Name or State Abbreviation on Detail Shelf

Tableau  tutorial

Step 6 – Put Default Size on Size shelf

Tableau  tutorial

Step 7 – Change the Marks type to Square

Tableau  tutorial

Step 8 – Reverse the scale of axis representing Row

Tableau  tutorial

Step 9 – Increase the Size of the Square marks appropriately

Tableau  tutorial

Step 10 – Choose to hide the header for both the axes

Tableau  tutorial

Step 11 – Put State abbreviation on Labels shelf with vertical centre alignment

Tableau  tutorial

Step 12 – Choose to hide grid lines

Tableau  tutorial

Step 13 – Put Profit on Colour shelf

Tableau  tutorial

Step 14 – Give final touches

choropleth in  tableau

And our Square Choropleth map is ready as shown above. If you want to go further down this lane then here is the article to create hex tile grid map in Tableau for your reference.

That is it for this time; stay tuned for more learning with Tableau.

About Tableau

Tableau (NYSEDATA) headquartered in Seattle, Washington has a mission to help people see and understand data. It offers a product portfolio for data visualization focused on business intelligence.

One can visit the official Tableau website to find more details about Tableau and its product offering and features.

Visualizing Fortune 500 with Tableau

This blog is a humble effort to re-create the work of my favourite design studio Fathom of visualizing Fortune 500 companies but with Tableau. In this blog we will build a Dashboard to explore Fortune 500 for the year 1955 to 2005. We will build an interactive dashboard with the help of global filters and dashboard actions so that users can analyse how company’s rank has changed over time. One will also be able see the Revenue and Profit trends if any.

Data

For the purpose of this blog we will source the data from publicly available data file of the listings found on Wikipedia. One might have to spend some time in order to collect and merge/collate the data for required metric for the analysis.

We will quickly understand the structure of the data that I have used and dimensions and measures therein.

The data has been sourced from listings available on Wikipedia and formatted appropriately for Tableau’s consumption. We have data for Fortune 500 companies between years 1955 to 2005 (55 * 500 = 25,500 data points) with information such as Rank, Revenue, Profit and web link to the company. The below table gives you a quick overview of important dimensions and measures present in the dataset.

Dimensions Measures
Year Rank
Company Revenue
Company Link Profit

Rather than asking question upfront, this time we will start making an interactive dashboard to answer our questions later.

Visualization Building

Step 1 – Connect to the data.

Open the Data worksheet from excel or text file that has the data. Note that we have all the dimensions and measures that we discussed above in the file Fortune500_1955-2005 opened below.

connecting data to tableau

Step 2 – Go to Sheet 1 and analyse/review the loaded data

reviewing data in tableau

Step 3 – Create a sheet with company configured as filter

The idea in this blog is to build a self explorable dashboard for which we need to give control in the hands of user to select a company to analyse its rank, revenue and profit over the years.

We are going to create a global filter for company and show it as quick filter with appropriate style (single value list).

To create a global filter, right click on chosen filter and then click on Apply Worksheets to select All Using This Data Source as shown below. The database or cylinder icon shown besides the Company dimension in filters shelf indicates that it is a global filter.

filter option in tableau

filter option in tableau

Step 4 – Create a simple tabular view of the min, max and median rank of a company

Create a simple table and use Rank measure thrice for computing highest, lowest and median rank of a selected company. The screenshot below shows the highest, lowest and median rank for General Motors. Name this sheet as “Ranks”.

creating a tabular view in tableau

Step 5- Create a sheet for plotting revenue and profit over time

In another sheet create a dual axis graph to show Revenue and Profit of the selected company over the years. Name this sheet as “Revenue & Profit”.

creating a new sheet in tableau

Step 6 – Create a sheet to plot rank vs. year for all companies

Place Year on columns shelf and Rank (selected as Dimension) on Rows shelf as below.

plot ranks vs years

Edit Rank axis to reverse the scale and apply custom range of 1 to 500 as shown below.

editing axis in tableau

Change the Marks type to Gantt Bar and adjust the colour transparency to 25% as shown below.

marks type in tableau

Put Company on Detail shelf as shown below.

steps for creating dashboard in tableau

We have our sheets ready for creating an interactive dashboard now.

Step 7 – Create a dashboard

Create a dashboard as shown below to include all the three sheets that we have created; Ranks, Revenue & Profit and Rank Trend. Format and lay it out as per your aesthetic choice.

creating a dashboard in tableau

We will add interactivity to dashboard by creating an action so that when a data point in Rank Trend sheet is chosen the other data points for the same selected company across the years are highlighted to create a visual rank trend.

We will create another action to dynamically change the other two sheets (Ranks and Revenue & Profit) to automatically get updated once a company is selected in Rank Trend sheet.

Let us create these two actions one by one.

Add a new highlight action by clicking Dashboard -> Actions.

Name the action as “Highlight Company”.

Select Rank Trend as source and target sheet. Choose “Select” as run action on.

Select “Company” for Target Highlighting ->Selected fields.

editing highlight action in tableau

Add a new filter action by clicking Dashboard -> Actions.

Name the action as “Filter Company”.

Select Rank Trend as source and Ranks and Revenue & Profit as target sheets. Choose “Select” as run action on. Choose Run on single select only.

Select “Company” for Target Filters -> Selected fields as shown below.

editing filter action in tableau

Dashboard Action once created should look like as shown below.

creating a dashboard in tableau

Step 8 – See the dashboard action in live

Click on any company in the Rank Trend sheet and observe the rank pattern of the selected company appear in front of eyes. The Ranks and Revenue & Profit sheet automatically gets updated based on the user selection.

live dashboard in tableau

Below is an animated gif of the dashboard that we have just created.

live dashboard in tableau

Stay tuned for more learning through visualization with Tableau.

About Tableau

Tableau (NYSE: DATA) headquartered in Seattle, Washington has a mission to help people see and understand data. It offers a product portfolio for data visualization focused on business intelligence.

One can visit the official Tableau website to find more details about Tableau and its product offering and features.

Exploring IMDb Top 250 with Tableau

Exploring IMDb Top 250 with Tableau

In this blog we will build a Dashboard and Story to explore IMDb(Internet Movie Database) Top 250 movies. We will build an interactive dashboard with the help of global filters and dashboard actions so that users can explore data and answer their own questions. With the help of Story we will try to answer a few of the common questions that can be thought by anyone. The other takeaway from this blog will be to use/embed Web Page objects in Dashboard to hyperlink to additional web–based information outside of data source, depending on data and on the user’s selection.

Data

For the purpose of this blog we will source the data from IMDb official website. The data is available here and here. One might have to spend some time in order to collect the data and required metric for the analysis. E.g. the result of sourcing data from first link above will have IMDb rating for movies but will not have user votes information.

top 250 movie ratings

Whereas sourcing data from second link will have most of the information including number of votes and user rating for each movie along-with release date.

all information about top 250 movies

Make sure to collect the URL for each of the movie which will be required for the exercise of embedding Web Page objects in Dashboard at a later stage. One can retrieve the URL of the movies as shown below. The method of collecting the data is left to the readers of this blog.

collection data for tableau visualisations

One can refer to alternative interfaces where plenty of information is available. Please read the copyright information for allowed usage.

altenative interfaces

For the benefit of all we will quickly understand the structure of the data that I have used and dimensions and measures therein.

The data has been sourced from imdb.com and formatted appropriately for Tableau’s consumption. We have data for top 250 movies between years 1921 to 2015 with information such as user votes and rating for each of the movie. The below table gives you a quick overview of important dimensions and measures present in the dataset.

Dimensions Measures

Movie Title

Rank

Movie URL

Ratings

Release Year

Votes

Rather than asking question upfront, this time we will start making an interactive dashboard to answer our questions later.

Visualization Building

Step 1 – Connect to the data.

Open the Data worksheet from excel or text file that has the data. Note that we have all the dimensions and measures that we discussed above in the file IMDb250_RatingsAndVotes opened below.

connecting data to tableau

Step 2 – Go to Sheet 1 and analyse/review the loaded data

reviewing loaded data

Step 3 – Create a sheet with each dimension and measure configured as filter

The idea in this blog is to build a self explorable dashboard for which we need to give control in the hands of user to play around with possible values of dimensions and measures.

For every dimension and measure except Movie URL we are going to create an individual global filter and show them as quick filter with appropriate style.

To create a global filter, right click on chosen filter and then click on Apply Worksheets to select All Using This Data Source as shown below. The database or cylinder icon shown besides the dimension or measure in filters shelf indicates that it is a global filter.

creating dashboard in tableau

So we have all the dimensions and measures configured as global filter as shown below in Sheet 1. Note that we have Movie Title configured as wild card match filter and Release Year as multiple values (custom list). One can rename Sheet1 to Filters.

creating dashboard in tableau

Step 4 – Create a simple tabular view of the data

creating tabular view of data in tableau

Step 5- Create a Dashboard with Filters and Table sheets

We will create a simple dashboard with Filters and Table sheets and use dashboard actions, web page embedding and little bit of formatting to make it interactive.

creating dashboard in tableau

Step 6 – Add a Web Page to Dashboard

Double click on Web Page in the left pane Dashboard section which will pop-up Edit URL dialog box. One can leave it blank and click on OK.

adding a web page to dashboard

It will embed a blank web page object between Table and Filters as shown below.

adding a web page to dashboard

Step 7 – Create URL action for dashboard

We will add interactivity to dashboard by creating an action whereby whenever we click on a movie in the table it will open up its corresponding URL (movie link on IMDb for details) in the embedded Web Page object area on the dashboard.

Below are the steps to add that action in the dashboard. Prior to this don’t forget to add Movie URL as a tooltip or a separate column in the Table sheet.

creating URL action for dashboard in tableau

creating URL action for dashboard in tableau

Give appropriate name to the Add URL action followed by choosing the source sheet as Table in which when selecting a movie will open a URL as captured in Movie URL attribute.

creating URL action for dashboard in tableau

Dashboard Action once created should look like as shown below.

creating URL action for dashboard in tableau

Step 8 – See the dashboard action in live

Click on any movie in the table and it should open up the link on IMDb for that movie which will have details about the movie, photos, trailer, description etc.

One can argue that layout of the dashboard is not optimized here for better viewing but the idea is to demonstrate the capability of dashboard and embedded web objects here. As a suggestion one can organize the filters on top as a row to make more space for web page object and table.

dashboard action live in tableau

This is a slightly optimized version of dashboard in terms of layout.

 dashboard action live in tableau

Step 9 – Create a story with various dashboards

Using above steps I have created various dashboards using which a Story can be created. A story is nothing but a collection of dashboards. It is like a book with pages where each page has some new story. One can give title to each page in the story and simply has to drag and drop dashboard or sheets onto the page. Below is a simple story with three tiles/pages each built for different view of the data and analysis.

creating story with various dashboards in tableau

Let us do some analysis now.

Is there any movie which has rating greater than or equal to 9 but votes less than a 700K?

Using our explorable dashboard one can adjust the filters accordingly to see the results. There is only one movie with such characteristics God Father Part – II of 1974 where the rating is 9 but the votes are close to 700K.

exploration and visualisation in tableau

How does the rating characteristic of top 50 movies look like?

Filter the ranks to retrieve top 50 movies on a second page of story named as Ratings and Movies.

It seems like the average rating for top 50 movies is around 8.5 and 8.6 with 9 movies in 8.5 bucket. By the way Gladiator is my favourite movie.

exploration and visualisation in tableau

How does the votes characteristic of movies with title containing “The”?

Filter the movie title with value as “*The*” in third dashboard Votes & Movies. It seems like there is no clear pattern in movie title having “The” in it and votes.

exploration and visualisation in tableau

Stay tuned for more learning through visualization with Tableau.

About Tableau

Tableau (NYSE: DATA) headquartered in Seattle, Washington has a mission to help people see and understand data. It offers a product portfolio for data visualization focused on business intelligence.

One can visit the official Tableau website to find more details about Tableau and its product offering and features.

Level of Detail Expressions – Part 3

This is the third and final part in a series of 3 blogs focussed on Level of Details (LOD) expression introduced in Tableau 9.0 version. In the first and second part we looked at the two variants of LOD expressions that is using FIXED and EXCLUDE scoping keyword in LOD expressions. In this part we are going to create LOD expression using INCLUDE scoping keyword. Before we proceed ahead with the details we will understand the mechanics of INCLUDE LOD expression.

The below graphic explains what happens in terms of Aggregation and Granularity for INCLUDE LOD expression. Tableau first adds the specified dimensions to the Viz LOD and performs the calculation i.e. INCLUDE keyword creates an expression that is less aggregated than the Viz LOD.

Aggregation and  Granularity for INCLUDE LOD expression

Data

To understand how INCLUDE LOD expression works so that everyone can understand its mechanics, we will use ODI Cricket batting data that we have already looked at before in earlier blogs.

For the benefit of new readers we will quickly understand the structure of the data and dimensions and measures therein.

The data has been sourced from howstat.com and formatted appropriately for Tableau’s consumption. This is the first important and often time-consuming step before data visualization and exploration can happen. We have batting data for One Day International (ODI) matches played between years 1971 to 2011 with close to 60,000 data points. The below table gives you a quick overview of important dimensions and measures present in the dataset.

Dimensions Measures
Country Runs
Player name Score Rate (runs per 100 balls faced)
Opponent country  
Ground  
Match Date  

As usual we will start with asking the question that we want to answer using LOD expression.

Let us say we want to analyse what is the average total runs scored by a player for each country. This means finding out how many players played for the country for the time duration that we have in the data and finding out the total runs scored by all the players and then taking the average. Let us see how we can accomplish this easily with INCLUDE LOD expression.

Data Exploration and Analysis

Step 1 – Connect to the data.

Open the Data worksheet from text file that has the data.

connecting data to Tableau

Step 2 – Go to Sheet 1 and analyse/review the loaded data

analysing and reviewing data  in tableau

Step 3 – Place Country on Row shelf

rows and columns in tableau

Step 4 – Place Runs on Column shelf and choose Avg. as aggregation method

 rows and columns in tableau

Step 5- Convert the visualization into data table

Converting the visualization into data table will help us understand how INCLUDE LOD expression works by comparing it with normal Average of Runs. As seen in the table below the average of runs depicts the average of runs scored by player and by each match date as the granularity of the data is by player and match date. Using INCLUDE LOD expression we will come up with the average by Player as shown in next step.

converting visualisation  into data table in tableau

Step 6 – Create a calculated field for INCLUDE LOD Expression

creating calculated field  for INCLUDE LOD expression

Step 7 – Put INCLUDE LOD Expression calculated field on the data table columns shelf

By default the SUM aggregation method is chosen for the calculated field and it represents the total runs scored by the country for the entire time duration and against all opponents. Note that we would have got the same values if we had directly put the runs on column shelf and applied the sum aggregation method as done in step 4. But as soon as we switch the aggregation to Average one can notice the difference between average computed for runs and average computed for the LOD expression.

selecting aggregation method  in Tableau

Step 8 – Choose Average as the aggregation method for calculated field

Verification of INCLUDE LOD  expression calculation

Step 9 – Verification of INCLUDE LOD expression calculation

Let us now verify how the simple INCLUDE LOD expression was evaluated. Put sum of Runs and distinct count of Players on column shelf.

Creating simple calculated  field

Step 10 – Create a simple calculated field without using LOD expression

rows and  columns in Tableau

Step 11 – Put Calculated field equivalent to LOD expression on column shelf

analysis in tableau

Observe the last two columns of the table in above screenshot, they are same as expected. We have created a calculated field without using the LOD expression in order to understand how LOD expression works.

Let us do some analysis now.

analysis in tableau

Which team has highest average runs by player?

South Africa it is. My guess is they had good all-rounders like Shaun Pollock, Lance Klusener, and Jacques Kalis who could bat extremely well hence pushing the average by player higher as compared to rest of the team.

Which team has lowest average runs by player?

England has average runs by player lower than even Kenya and Zimbabwe partly because the number of distinct players that have played for England (220 it is) is highest among the entire lot hence pushing the average down.

Stay tuned for more learning through visualization with Tableau.

About Tableau

Tableau (NYSEDATA) headquartered in Seattle, Washington has a mission to help people see and understand data. It offers a product portfolio for data visualization focused on business intelligence.

One can visit the official Tableau website to find more details about Tableau and its product offering and features.