Post on 03-Aug-2020
Tableau tutorial using the city of Ottawa 2011-2013 crime Data
Tableau is a free tool that according to its mission statement helps “people see and understand data”. The program helps the people for whom we write stories understand them better by seeing certain trends by pointing and clicking. Journalists are using Tableau to tell excellent stories that you’ll find on this syllabus and by subscribing to listserves such as the National Institute for Computer Assisted Reporting, which goes by the more well-known acronym familiar to data journalists, NICAR. Subscribing to the NICAR listserv will be well worth your while. For it is a venue where some of the best journalists in North America and beyond discuss tools like Excel, Fusion Tables, Tableau, how they use them, the problems they encounter.
The best way to learn any of these tools is to practice, practice, practice. Tableau has some wonderful online tutorials. The NICAR listserv is an excellent place to pick up tips.
Let’s get started.
We’ll continue to work with the 2011-2012 Ottawa Crime data, which we’ve used to learn filtering, sorting, ratios and pivot tables in Excel, and creating heat maps in Fusion Tables. Now we’ll see how the same data set in Tableau helps people see trends in an interactive fashion.
If you haven’t done so already, the first step is to download the public version of Tableau. (Once you improve, you might want to graduate to the professional version).
1) Download the 2011-2012 Ottawa crime data we’ll be using for this tutorial.
2) Once you download, the Tableau Public icon will appear on your
desktop.
3) Select the “Open Data” tab
4) Select the Microscoft Excel open to obtain the Excel workbook
we’ve already downloaded in step one.
5) 6) Select the OttawaCrime2011-2012 worksheet ( You can upload
Excel workbooks with multiple worksheets from which to choose. For the sake of simplicity, we’re using a workbook with one worksheet.)
7) What you get is an interface that resembles a pivot table.
8) 9) For a good explanation of the “Measures” “Dimensions”
categories, this Tableau training video is a good place to start the instructional video, Tableau Public Training
10) The Measures and Dimensions contain the fields in the Excel worksheet. The values (what we do the math on) are under Measures. The fields containing text are in Dimensions. Let’s move “Year” up to Dimensions, as we only want to group by year, not do any math with those values.
11)
12) Let’s create a table that groups the Offences and sums the offences. To do so, click and drag the offence numbers in the “Offence” field under Dimensions, and drop it into the blank table’s row label.
13)
14) You can see that Offences the row labels ( just like a pivot table). Now let’s drop the numbers into the column, which, because Tableau treats as a number will appear as such.
15)
16) You can see that the Actual field appears in the Marks section. This is where the math occurs, as well as the formatting, a task similar to Excel.
17) Before sorting them in descending order, let’s format the numbers as currency with zero decimal points.
18)
19) 20) Once you’ve made your “Number” selection with zero
decimal points, close the “Format SUM(Actual) box to the left of the table, make the table wider by placing your cursor on the table’s outer right-hand boundary until the cursor turns sideways, and then drag it to create more space.
21) Drag the “Year” from Tableau’s Dimensions section into the Columns section.
22) 23) We can see that, just like in a pivot table, Tableau has
grouped the values by year. 24) This will do. Name the worksheet, Offences and go to a new
one. 25) In this one, we will repeat the same steps we used to get the
Offences table, but instead using the Offences value, we’ll use the Percapita value.
26) Your table should look like this.
27) 28) Name this worksheet “Percapita”. 29) Now let’s repeat the same steps we to get a worksheet that
gives us the percapita counts of offences per ward in 2011 and 2012.
30) 31) Rename this worksheet WardsPerCapita. 32) Now we have three tables we’ll join in the dashboard. 33) Right click on the adjacent tab and select the “New
Dashboard” option.
34) The Dashboard is where we will link the Offences, Percapita and WardsPerCapita. You can see the icons for each table on the left-hand side.
35) 36) Drag the Offences worksheet into the adjacent space.
37) 38) Drag the Percapita workbook just below the Offences table
and release the cursor.
39) 40) Drag the WardsPerCapita table icon to the right of the
Offences table.
41) 42) I have also widened the Offences and Percapita tables
manually in the dash board, using the cursor to drag and widen each table, a process explained in step 20.
43) 44) Now I want to use the Offences table as a “Filter”, meaning
when I select a category it will return corresponding values in the other tables. To do this, click on the Offences table in the dashboard to activate it, which produce a thin grey bar at the top with a downward arrow on the eight-hand side. Click the arrow to produce a drop-down menu, and select the “Use as Filter” option.
45) 46) By choosing Theft $500 and Under, we can see the overall
per capita rates for each year, an in the third table the rates for that offence broken down by ward. You’ll also notice that I made the offences column in the Offences table a little wider by using the cursor to drag and click.
47) Rename the Dashboard.