0% found this document useful (0 votes)
4 views4 pages

Tableau Worksheet

This worksheet provides a comprehensive guide for using Tableau to visualize data from the DPD_export.csv file, which contains police emergency response data from Detroit. It includes step-by-step instructions for opening the data, creating various visualizations such as bar charts and maps, and setting up a dashboard with filtering actions. The document emphasizes the importance of understanding data dimensions and measures for effective visualization.

Uploaded by

barvind
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views4 pages

Tableau Worksheet

This worksheet provides a comprehensive guide for using Tableau to visualize data from the DPD_export.csv file, which contains police emergency response data from Detroit. It includes step-by-step instructions for opening the data, creating various visualizations such as bar charts and maps, and setting up a dashboard with filtering actions. The document emphasizes the importance of understanding data dimensions and measures for effective visualization.

Uploaded by

barvind
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Worksheet on Tableau

Worksheet on Tableau
Database: DPD

Objectives of this exercise:

This worksheet provides step-by-step instructions for your introduction to data visualization in Tableau.
Please always feel free to go to the web for help and reference. For detailed information, the Tableau
website provides great references: https://help.tableau.com/current/pro/desktop/en-us/default.htm.

Be careful copying-and-pasting statements from this worksheet to your Tableau window. Word
automatically imposes its own formatting, which messes things up (like replacing straight quotes with
curly quotes), so some copy-and-paste jobs may not work. You may have to re-type them, and then they
will work just fine. In any case, excessive copy-and-paste also prevents you from learning and should thus
be avoided.

Background:

The DPD_export.csv file contains the dataset that we will use in this worksheet. The following gives a
description of the data:

DPD_export: All 911 police emergency responses and officer-initiated calls for service in the City
of Detroit between September 6th 2021 and October 6th 2021.
a. index: The primary key that uniquely identifies each incident in the dataset
b. zip_code: The zip code where the incident occured
c. priority: Internal priority put on resolving the incident with 1 being highest priority
d. population: Estimated number of people living in the zip code of the incident in 2019
according to the US Census Bureau
e. officerinitiated: Indicator whether the call was initiated by the officer or a request
f. totalresponsetime: Total minutes between the time of the call and the officers’ arrival at
the incident location
g. totaltime: Total minutes between the time of the call and the officers’ departure from
the incident location
h. longitude: The longitude of the location where the incident occurred
i. latitude: The latitude of the location where the incident occurred

The information in this dataset was curated from two main data sources (the Detroit Open Data Portal
website and the US Census Bureau website).

1
Worksheet on Tableau

Part I: Opening data in Tableau

1. To access Tableau Public, register for an account on https://public.tableau.com/app/discover.


After registering, return to the same website and sign in. To open Tableau Public, you can then
hover over the “Create” option and select the “Web Authoring” option.

2. Once you open Tableau Public, the website will ask you to connect to data. Here you select the
DPD_export.csv file from where you saved it. After loading the data, click the “Sheet 1” tab in the
bottom left. This will open a new worksheet where we can create visuals.

Part II: Visualizing data with Tableau

We will now visually present the Detroit Police Department data using Tableau. In the following, we will
create a bar chart, side-by-side bars chart, and a map using Tableau’s built-in modes. Below, the
instructions will guide towards a basic plot that can be edited to your own preference.

3. Before making the charts, we have to make sure that Tableau knows what columns are
dimensions (categorical variables, such as zip codes) and measures (quantitative variables, such
as population numbers). On the left side of your first sheet, you can see the data pane, where
under Tables you can see all the variables. The grey horizontal line divides the dimension and
measure areas. Most variables are automatically assigned correctly by Tableau, but “Priority” and
“Index” might be wrongly assigned to be a measure (under the line), while it should be a
dimension (above the lines). If you need to fix this, drag the “Priority” and “Index” variables over
the line.

4. Now, we can create our first bar chart that shows the number of calls by priority. To do this, select
“Priority” and “DPD_export.csv (Count)” from the data pane. Then, under the Show Me pane in
the top right, click on the “horizontal bars” picture. This should present you with a horizontal bar
chart showing the “CNT(DPD_export.csv)” by “Priority”. Here, the “CNT(DPD_export.csv)” value
counts how often a row in the dataset has a certain priority, i.e., how often a call has a certain
priority.
To change the chart to a vertical bar chart, we can swap the “Priority” and “CNT(export.csv)” in
the Columns and Rows area at the top. Changing the title and the axes can be done by right-
clicking on each of them.
The final chart shows us that by far most of the calls have medium priority 3, while there are also
relatively many calls from the highest priority 1 and high priority 2.

2
Worksheet on Tableau

5. Next, we open a new worksheet to create a side-by-side bar chart of the average response time
and average total time by priority. In this case, you select the “Priority”, “Totalresponsetime”, and
“Totaltime” columns from the data pane, after which you select the “side-by-side bars” picture
under the Show Me pane.
To get the average response time and total time, we need to change away from the sum metric.
To do this, right click on “SUM(Totalresponsetime)” and select “Average” under “Measure”, and
repeat this for “SUM(Totaltime)”.
From this, we observe that the highest priority 1 calls have a slightly longer response time than
other calls, which should not be the case. By filtering out calls that were initiated by an officer, we
can see this is not the case for normal calls by the public. To filter out these officer initiated calls,
drag the “Officerinitiated” variable from the data pane to the “Filters” pane, and only keep the
“No” data.

6. We can also create some good-looking maps in Tableau. One option is to map the average
response time in each zipcode. For this, open a new worksheet, where you select “Zip Code” and
“Totalresponsetime”, and click on the “maps” picture under the Show Me pane.
Again, we can swap the “SUM(Totalresponsetime)” to “AVG(Totalresponsetime)”. To make the
map easier to read, you might want to change the color scheme. This can be done by clicking on
“Color” in the “Marks” pane, and then on “Edit Colors…”. If we want to put the Zipcode number
as a label in our map, we can drag the “Zip Code” to “Label” in the “Marks” pane.
Again, we might want to specify that we are only interested in calls that were not initiated by
officers, for which we can use the “Filters” pane. Similarly, to get more information out of the
map, you might want to filter out zip codes that have very little data. This can be done by dragging
the “DPD_export.csv (Count)”, which counts the number of calls, to the “Filters” pane and set the
minimum number of calls to say 100.
The final map shows that the longest response times are observed in the outer areas of Detroit,
whereas the fastest response times happen in the central area.

7. With these charts made, we can create a dashboard by clicking on the New Dashboard button at
the bottom, instead of the New Worksheet button. In this new window, we see a dashboard
canvas in the middle of the screen and a dashboard pane on the left. In the dashboard pane, we
can see the three different sheets that we have made, in addition to a device preview option (can
be used to see what the dashboard looks like on a device such as a browser or phone), a size
option (can be used to determine the resolution of the dashboard when used on another device),
and objects at the bottom (can be used to add text, images, web links to the dashboard).
Let us create a dashboard that shows our priority bar chart and response time map at the same
time. Drag the sheet of the bar chart from the dashboard pane on the left to the canvas. You

3
Worksheet on Tableau

should see everything that was shown in that sheet on your dashboard now. Next, drag the sheet
of the map in, placing it below the bar chart. You can make the map bigger by dragging the
boundary between the bar chart and the map higher up. Note that you can move the objects of
your dashboard (such as the legend) around.

8. Next, we are going to add a filtering action to our dashboard. This action will allow us to choose a
priority in our bar chart and filter our map based on that. In other words, the map will only show
the data about the priority that we have selected in the bar chart.
The option to add actions to our workbook can be found under Worksheet -> Actions… at the top.
In the popup box, click on Add Action and select the Filter…option. In the following popup box,
you can first give a name to your filter such as “PriorityFilter”. Then, under Source Sheets, select
the sheet that we would like to use as a filter (in our case, the priority bar chart sheet), while
under Target Sheets, we select the sheet that we would like to be filtered by our action (in our
case, the response time map sheet). The options on the right can be used to indicate when and
how the action should be run. In our case, we run the filtering action when we Select a zip code
in our source sheet of the bar chart, and we will Keep filtered values in our target sheet of map.
After setting all these settings, click on OK, and if your filter appears in the list, you can click OK
again. Now, if you click on one of the priorities in your bar chart, then your map should show only
response times for that priority.

To save the workbook, use the Publish As option in the top right (after publishing, if you click the X in the
top right, you will see that the workbook was saved).

You might also like