Unit 6 Self-Check Assignment: Milligan, Chapter 12 |
Students Name:
Professors Name:
Date: 23/09/2025
Welcome to your hands-on activity! This assignment invites you to work with Tableau using a mix of generated and real-world data. To complete this activity, you will follow these instructions:
- Download the attached spreadsheets and upload the datasets into Tableau.
- Go through this document, and use Tableau to answer all the questions listed below. Where applicable, paste screenshots into the template below.
- When you are ready, complete the online quiz, which verifies your homework. You are welcome to refer to this document as you complete the quiz.
- You are welcome to use the quiz results to update your homework file.
- Remember, you can always reach out for help to your FA or instructor if needed.
- If you need to adjust the size of your visualizations to match the options in the questions, use the “Format”->”Cell size” options. For example, “Ctrl+Shift+B” on a Windows computer will make the visualization bigger, and “Ctrl+Up” will make it taller.
You will find four attachments required for this exercise:
- Baltimore City Crime Data June 2023 (3 worksheets)
- San Francisco Real Estate Sales
- University Courses and Room Capacities (2 worksheets)
- University Floor Plan (image)
Question 1: Makepoint() and Makeline() functions
You are working for an analytics company that has contracted with the City of Baltimore to evaluate the locations of crimes. The city has provided information about crimes committed during June 2023. They have provided the locations of the police stations in the city as well. When a crime is logged in the system, there is a district assigned to the crime record.
The city has a headquarters and nine police stations in districts located around the city. They are trying to determine how to deploy the police force in the vicinity of each district.
First, you will visualize all of the crimes committed within the city of Baltimore. Load the Baltimore City Crime Data June 2023 Excel sheet and pick the first worksheet: All Districts.
Click on the latitude and longitude data points, and then click on “Show Me” to select a symbol map.
Alt text: Symbol map
Go up to the top menu bar under “Analysis” and turn off “Aggregate Measures.” You should now have a map with many dots:
Alt text: Map of dots
Drag the “District” dimension onto Color in the Marks tab. Your map should now have dots with nine colors. Add the “District” onto Label in the Marks tab. Use your mouse to hover over the districts so that you can learn where they are located.
Alt text: District map
You can immediately see that the outer perimeter districts (Northwest, Southwest, Southern, Northern, Northeast, and Southeast) are bigger, spread –out districts. The Western, Central, and Eastern districts are smaller. This is probably happening because there are more people in the middle of the city, and when you get further away from the center, the population is more dispersed.
While this map is helpful to get an idea of where crimes are committed, it is difficult to understand the relationship to the police department locations.
For that reason, you are going to create lines for one district to visualize how far away some crimes are committed from the district’s police department location. Load the Central District worksheet from the Baltimore City Crime Data June 2023 file. Create a new worksheet and create another map by selecting the Latitude and Longitude dimensions. Then select the map option under “Show Me” (the same procedure to make the map above). Again, turn off “Aggregate Measures” under the “Analysis” tab.
Alt text: Analysis map
Next, you’ll create two calculated fields: one for the police department latitude and another for the longitude. You will use the Fixed function to look at all the records and pick out any that are the type “Police Department.” First, create a calculated field by clicking on the “Analysis” menu and selecting “Create Calculated Field” (you can also right-click on the “Tables” tab) and name it “Police dept Latitude.” Input the LOD (level of detail) calculation below:
{FIXED : MIN(IF [Type] == “Police Department” THEN [Latitude] END)}
Do the same thing again to create another calculated field named “Police dept Longitude” with the following LOD formula:
{FIXED : MIN(IF [Type] == “Police Department” THEN [Longitude] END)}
Now, you will use the fixed data to create two points and a line using the MakePoint and MakeLine functions. Create another new calculated field called “Line,” and enter the formula below.
Alt text: latitude and longitude
MAKELINE(
MAKEPOINT([Police dept Latitude], [Police dept Longitude]),
MAKEPOINT([Latitude], [Longitude])
)
Now, drag the “Type” over to the Colors Mark and change the Marks type to “Circle.” You should now have solid circles with at least 1 color that is different. The circle with the different color is the police department location. Use the annotation (right-click on the orange dot) to annotate the point.
Alt text: Tableau book
Alt text: Dot map
Next, take the “Line” calculated field that you created, and drag it into the Marks area (defaults to Detail), then change the Marks type to “Map.” Your map will now change to a collection of lines that are measured from the Central Police Department to each crime location.
Alt text: map
Alt text: Line map
This visualization immediately shows us that the central police district doesn’t look very centrally located within its district.
The police department has now asked you to perform this same visualization for the Eastern District. Follow the same steps you used for the Central district but use the “Eastern District” worksheet provided in Baltimore City Crime Data June 2023.
Which of the following visualizations matches the Eastern District?
Alt text: District line maps
| Question 1 Answer: | Option 8 |
<<insert your screenshot>>
Question 2: Distance calculation
Next, let’s calculate the actual distances between each crime committed and the district’s police station.
Go back to the worksheet on which you displayed the Central District map: the collection of lines measuring the distance from the Central District police station to each crime.
In this worksheet, create a new calculated field called “Distance from police dept” using the formula below. (Be sure you’re on the Central District sheet.)
Alt text: Latitude and longitude
DISTANCE(
MAKEPOINT([Police dept Latitude], [Police dept Longitude]),
MAKEPOINT([Latitude], [Longitude]),
‘mi’)
Drag that new calculated field onto the Marks area Tooltip. The calculated field will now show in the Tooltip when you hover over a line.
Alt text: tooltip
While this is interesting, it isn’t helpful in terms of analysis.
Let’s try to add distance to another visualization.
Go to a brand new worksheet, choose Central as your data source, and select the “Distance from police dept” and “Description” measures. Under the “Show Me” menu, pick the Treemap option.
Alt text: treemaps
When you look in the Marks area, you will see the default aggregation is set to SUM for the distance from the police station. Change the default aggregation to average for both the size and the color. (Note: If you see multiple different treemaps, you might have Aggregate Measures turned off in the Analysis toolbar menu.)
Now, you have a visualization that is showing the crimes that are farthest away from the police station. This might help to prompt the leadership to consider increasing a police presence in the areas farther away from the police station.
Now, let’s add another measure to this treemap to understand how many of these crimes are happening at what average distance away. Drag the measure “Central District (Count)” onto the size marks (it should remove the Average Distance from the Police Department). Now, the visualization is using the count of crimes by description to create the size and color based on the distance from the police station.
Hover over the largest block in the treemap, Common Assault. You will see that the count of the Central District was 119, and it was an average of 0.714 miles away from the police station.
Find the “Auto Theft” crime. What was the count and the average distance from the police station in the Central District?
Option A: Count 91, Average distance .902
Option B: Count 91, Average distance 82.04
Option C: Count 119, Average distance 84.99
Option D: Count 59, Average distance 1.009
| Question 2 Answer: | Option A: Count 91, Average distance .902 |
<<insert your screenshot>>
Question 3: Buffer function
The leadership at the Baltimore Police Department would like to see how many crimes are committed one mile away from a police district building. Therefore, you will start with the Central District. Make a new worksheet, load the Central District data, click on the latitude



Reviews
There are no reviews yet.