One of my favorite parts of data science is communicating findings in a way that is compelling and easy to understand. That is why, for my investigation at Metis, I decided to learn how to use Tableau, which provides data analysis software for business intelligence.

There are some wonderful resources available to learn Tableau, many of which I used while I was learning how to use the software. This blog post is intended to provide a gentle introduction to Tableau for beginners, demonstrating some of the functions I have found most useful in my projects.

Data

For this example, I will use the AirBnB New York dataset, which is available for download on the Tableau Resources site. I am using Tableau Public, which you can sign up for and download here.

I conducted some initial data cleaning in a Jupyter Notebook using Pandas, primarily to remove null values from the dataset. I also removed a few Property Types which I deemed to be irrelevant, such as ‘Hut’ and ‘Tent.’ Following these steps, I had a dataset of 21,980 listings across New York’s five boroughs.

Loading the dataset

Tableau can connect to multiple data sources, such as Microsoft Excel, Text files, and even databases. As the AirBnb dataset is an Excel file, we will select ‘Microsoft Excel’ to load the file.

The loaded dataset can then be viewed at the ‘Data Source’ tab:

View of the Data Source page

Navigating the Tableau interface

Although learning a new tool can seem intimidating, the Tableau interface is intuitive and user-friendly. The figure below highlights a few of the most important fields that can be used to navigate the interface.

View of the Tableau interface
  1. Data and Analytics panes: The Data pane lists the data that is loaded, separated into Dimensions (categorical) and Measures (numerical). In the Analytics pane, you can add summary statistics and models to the visualization.

Creating calculated fields

One of the Tableau functionalities that I really enjoy using is creating calculated fields based on the available features. As the AirBnb dataset provides Price and Beds data for each listing, we can use these features to create a new feature, Price per bedroom. To do this, right click on the Price column, and select ‘Create Calculated Field.’ A pop up will appear, in which we can populate the details of the field we want to calculate, shown in the figure below:

View of the pop up that appears to create a calculated field

Notice the bottom left of the image says ‘The calculation is valid.’ In this corner of the box, Tableau provides guidance on errors in the calculation which should be corrected before it will accept the calculated field.

Tableau provides many awesome functions which you can use to create calculated fields. You can learn more about them here.

Creating our first figure

Create a new worksheet by selecting the ‘New Worksheet’ icon in the bottom left of the interface.

For this figure, we will look at the average price per room by zip code. To do this, drag the zip code feature to the main window. As you see in the figure below, Tableau will automatically recognize this as a geolocation tag and will populate longitude and latitude in the Columns and Rows fields.

First view of the figure with zip codes populated

To add the encoding for average price per room, drag the ‘Price per room’ feature we created into the ‘Marks’ shelf. Then click the icon on the left of the Price per room pill to change it to ‘Color’. Also note that Tableau will automatically sum this feature. To change it to an average, click the drop down arrow on the right of the pill, scroll down to ‘Measure’ and select ‘Average’.

Next, we can add a heading to indicate the key takeaway of the figure so it is easy for the reader to quickly understand the main point of the figure. I will add, “Manhattan zip codes have the highest average price per room.” To do this, double click the ‘Heading’ field at the top of the figure and a pop up should appear where you can edit the content. The final version of the figure can be seen in the image below.

Our final figure

Other tips and tricks

While this is meant to be a gentle introduction to Tableau for beginners, there are a few additional tricks I have learned that I have found to be useful:

  • Creating scatter plots: When creating a scatter plot, be sure to turn off ‘Aggregate Measures’ in the ‘Analysis’ tab, otherwise all of the data points will stack on top of each other.
Edit Toolbar Settings

always a student

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store