Tutorial – Data Exploration – Tableau Basics 1 – Example: Trees
This tutorial is related to Data Analysis and Data Exploration and is used as a resource for our talks, presentations and workshops. It shows how to use the basics of Tableau’s Public software to explore open data from the City of Edmonton; specifically this tutorial uses a subset of the data for trees planted in Edmonton parks.
Prologue: The Software and the Data
A Bit about Tableau:
Tableau is a standalone analysis and visualization tool. Data is manipulated through a drag-and-drop interface and much of the work can be accomplished with little knowledge of programming. Structured data can be loaded from text files or directly from databases and interactive analysis is performed through the program graphical user interface. With the application you can explore data visually, interactively, and the results of numerical and statistical processing are easily translated to visual representations.
Tableau Public is a free. One restriction is that you can only save your workbooks in a publicly viewable space. The accounts are also limited to 1GB. However, for testing and learning is seems quite adequate. (See the Tableau Public site for more information, restrictions and conditions of use.)
The Data Set:
The data set used for this tutorial is based on trees owned and maintained by the City of Edmonton and is from the City of Edmonton Open Data Catalogue (just search for Trees). Here is the specific location for the for the source data: https://data.edmonton.ca/Environmental-Services/Trees/eecg-fc54 (the data has about 320,000 records so it might take time to view).
For demonstration purposes the data set was reduced to contain only the trees located in City of Edmonton Parks.
Getting Tableau Public:
Just go to their web site and follow the instructions: http://www.tableau.com/products/public
Getting Started and Loading the Data
- First let’s look at what the first few line of the data set looks like in Excel:
- (The data file used for this tutorial is available for download: Trees_-_Species__Map_View_inParksonly.xlsx 15MB)
- If you downloaded and installed Tableau using the defaults there should be a shortcut icon on your desktop:
- Just double click to start Tableau, and since our data is in Excel format, click on Excel:
- Tableau will present us with a “Preview” page so that we can check the data.
- The software has made a number of assumptions based on the data that it read in.
The icons/text under the column heading gives an indication of the assumptions made.
For numerical values the “#” is used, dates are represented by calendar icons,
text by “Abc”, locations with globe icons, and there are others.
The Sidebar – Data Window:
The data area has two main sections, namely Dimensions and Measures. Dimensions are the categorical, descriptive, text data. These values are used as the axes for the charts, graphs, visualizations.
Measures are the numerical data. These are the values that are plotted, and that we do calculations with.
In our example the columns with text and a date are automatically put into the Dimensions area. All of the other values, i.e., the numerical values can be found in the Measures area. (In the previous step we changed the format of the ID for numerical to string for this reason.)
Working with a Map and Putting Data on a “Shelf”
For this data set there is location data, i.e. Latitude and Longitude, so we can display a map.
- To plot the data on to a map simply double click on both the Latitude and Longitude values in the Measures area of the Data side bar.
- Double clicking the variables automatically put Longitude into the Columns “shelf” and Latitude into the Rows “shelf”. The single dot in the map is just the average longitude and latitude of the data set.
Each Tree on the Map
- What would be more interesting, since we had the location of each tree, is to have a “dot” for each tree. This can be done by clicking and dragging the ID variable from the dimensions area onto the Details “shelf”. This will result in a pop up dialog box, which for our case, “Add all members” is selected.
- Here is the result of the step:
Putting More Detail on the Map
- We can add more detail by clicking and dragging “Genus” to the Color “shelf”. (As with the previous step, click on “Add all members” in the pop up dialog box.)
- Since we have values that can be used for size, let’s put the “Diameter at Breast Height” onto the Size “Shelf”:
- And here is our Map:
- In the application you can zoom in on the map, and click on each of the Genus to see only those trees. (You can try this out using the final result in which the dash board is loaded onto the Tableau public site, the link is on the bottom of this page. However let’s continue and create a few more visualizations.)
Creating a Date Slider for the Map
- The data set has values for the date the trees were planted, so let’s use that to create a Date Slider.
- The first step is to click on the small triangle on Planted Date variable and select “Convert to Continuous”:
- The next step is to again click on the small triangle on the Planted Date variable and this time select “Show Quick Filter”:
- Now there is a slider on the right hand side of the map window. You can use the slider to change the dates (or click on the date to get a calendar):
Creating a New Sheet for a Bar Chart
First we need to create a new sheet. This is done simply by clicking on the New Sheet icon at the bottom of the window.
Moving Data to the Column shelf and Row shelf, and Selecting Bar chart
- For this example we click and drag “Genus” to Rows and “Number of Records” to Columns. Then, under the “Show Me” window the icon for a Bar Chart is selected. (You can also Ctrl click the data items and select the Bar Chart icon, all in one step.)
- And here is the result:
Adding Colors and Sorting the Chart
- To keep the colors consistent with the previous sheet, click and drag the Genus to the Colors shelf (follow the same step as on the previous sheet).
- Next we’ll use the Tool Bar to sort the chart, and have the chart fill the entire view:
- Here is the Sheet with the Bar Chart:
- To complete this step “Sheet 2” should be renamed to “Bar Chart”
Sheet 3: An Area Chart – Showing Changes Over Time
For sheet 3 let’s create an Area Chart.
Create a new Sheet:
- As with the preceding section, create a new sheet by clicking on the “new sheet” icon at the bottom of the window.
Moving data to the Columns shelf and the Rows shelf
- Click and Drag the “Planted Date” to the Columns shelf
- Next, click and Drag the “Number of Records” to the Rows shelf
- To keep the colors consistent with the previous sheets, click and drag the Genus to the Colors shelf (follow the same step as on the previous sheets).
- Here are our results so far:
- For this data set, most of the planting activities seem to be quite recent, so let’s just look at the past 10 years:
- The default is a line graph. However, for this example an Area graph may be more usable.
Changing the Chart Type to Area:
- It is straight forward to change the type of graphs and charts. Under the “Marks” card, use the pull down arrow beside “Automatic” and select “Area”:
- We are also going to sort the data. Under the Genus there is a pull down menu, select “Sort…” then in the resulting pop up box, select “Ascending”.
More Resources for Tableau Public:
Check out the Tableau Public web site for how-to videos and sample data sets.
The Results – The Dash Board Loaded onto the Public Site
Creating a Dash Board:
Working with the Dash Board:
- A new window will open with a blank area to create a dash board, and along the left side the data sheets for the workbook will be listed.
- To add objects to the work area simply drag and drop:
- And here is the Dash Board
- Editing and Formatting:
- You can move and resize the objects with the mouse.
- If you hover over the various chart names you will see pull down arrows that will reveal options for each chart type.
- To add Text boxes use the Text icon on the left side of the window.
- As with most formatting, trying different arrangements until you find one that works for you, seems to be the norm.
Linking the Charts together:
- To have the “Planted Date” slider control both the Bar Char and the Time Line, just use the pull down arrow and select “Apply to Worksheets -> All Using This Data Source”
- You can also use the bar chart as a filter for the other charts; just click on the down arrow and select “use as filter”
- Now when you click on one of the items the other charts will change as well (click on a white space to bring back all the items)!
The Final Dash Board:
To Save the Dash Board to the Public Site
- To save the dash board just click on “File” then on “Save to Tableau Public as …” (if you do not have an id at this point, the software will request that you create one)
Here is what the final results looks like on the Public Tableau site (click on the image and it will take you to the site)
Take me to the: Tree Types in Edmonton Parks – Tableau public site
(If needed, the Direct link is: https://public.tableau.com/profile/publish/TreeTypesinEdmontonParks/TreesinEdmontonParks#!/publish-confirm)