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.

sc_dataExTableauHeader

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

 

  • If you downloaded and installed Tableau using the defaults there should be a shortcut icon on your desktop:
    • sc_dataExplore_Tableau_img01
  • Just double click to start Tableau, and since our data is in Excel format, click on Excel:
  • sc_dataExplore_Tableau_img07
  • Tableau will present us with a “Preview” page so that we can check the data.
  • sc_dataExplore_Tableau_img06
  • sc_dataExplore_Tableau_img06aThe 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.

 

  • For our case the only value that needs to be changed is the ID number; this should be a text value.
    • To change it simply right-click on the “#” and select String from the resulting menu:
    • sc_dataExplore_Tableau_img08
  • Once the data has been checked, Click on the worksheet to open Tableau work area:
    • sc_dataExplore_Tableau_img09

A Brief Orientation to the Tableau Interface

sc_dataExplore_Tableau_img10

The Sidebar – Data Window:

sc_dataExplore_Tableau_img11We will explore the interface through our example, starting with the Sidebar Data area.

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.
  • sc_dataExplore_Tableau_img12
  • 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.
  • sc_dataExplore_Tableau_img13
  • Here is the result of the step:
  • sc_dataExplore_Tableau_img14

 

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.)
  • sc_dataExplore_Tableau_img15
  • Since we have values that can be used for size, let’s put the “Diameter at Breast Height” onto the Size “Shelf”:
  • sc_dataExplore_Tableau_img16
  • And here is our Map:
  • sc_dataExplore_Tableau_img17
  • 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”:
  • sc_dataExplore_Tableau_img18
  • The next step is to again click on the small triangle on the Planted Date variable and this time select “Show Quick Filter”:
  • sc_dataExplore_Tableau_img19
  • 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):
  • sc_dataExplore_Tableau_img20
  • And here is our new Map showing the trees planted over the past 10 years:
  • sc_dataExplore_Tableau_img21
  • For this sheet let’s rename it to “Map”. Simply right click on the tab at the bottom, i.e., “Sheet 1” and rename.
  • sc_dataExplore_Tableau_img22

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.

  • sc_dataExplore_Tableau_img23

 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.)
  • sc_dataExplore_Tableau_img24           sc_dataExplore_Tableau_img26
  • And here is the result:
  • sc_dataExplore_Tableau_img27

 

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:
  • sc_dataExplore_Tableau_img28
  • Here is the Sheet with the Bar Chart:
  • sc_dataExplore_Tableau_img29
  • 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:
  • sc_dataExplore_Tableau_img30
  • For this data set, most of the planting activities seem to be quite recent, so let’s just look at the past 10 years:
  • sc_dataExplore_Tableau_img31
  • 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”:
  • sc_dataExplore_Tableau_img32
  • 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”.
  • sc_dataExplore_Tableau_img33     sc_dataExplore_Tableau_img34

 

  • For completeness the sheet is renamed to “Time Line” and here is the result:
  • sc_dataExplore_Tableau_img35

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:

  •  To create a new Dash Board just click on the dash board icon on the bottom of the window
  • sc_dataExplore_Tableau_img50

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:
  • sc_dataExplore_Tableau_img51
  • And here is the Dash Board
  • sc_dataExplore_Tableau_img52
  • 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”
  • sc_dataExplore_Tableau_img102
  •  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”
  • sc_dataExplore_Tableau_img54
  • 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:

sc_dataExplore_Tableau_img100

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)
  • sc_dataExplore_Tableau_img100b

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)

sc_dataExplore_Tableau_img101

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)

Need help with Data Analysis? Would you like to take a workshop on Data Exploration using Tableau?

Contact us
Contact us