Descriptive Analytics with Pivot Tables
2025-01-22
HW 2 is due Monday, 1/27/25
Demo videos for HW 2 are posted
In-class Polling (Session ID: bua345s25)
Open the data file Lecture 4 Review Question Data
in the Blackboard section for Lecture 4.
Save the Lecture 4 Review Question Data.xlsx
dataset to your BUA 345 folder.
Convert these data to an Excel table
Remove Duplicates using all columns except OBS NO.
.
Sort data by Price
from ‘Largest to Smallest’
Use the first indicator
icon set to classify PRICE
in Conditional Formatting
.
What is the lowest price in the ‘High’ (green checkmark) category?
Describing and summarizing data quickly is an essential skill.
Excel has a powerful set of tools for this purpose, Pivot Tables.
To Access these tools:
Convert our 2024 Movie Data to an Excel Table (Insert > Table)
Click any cell within table, so that ‘Table Design’ tab is visible.
Click Summarize with PivotTable
.
Summarize with PivotTable
, you will see this pop-up which should be populated as follows:Specify `Existing Worksheet.
Specify G1
for the location.
Here a few examples of the many questions we can answer:
What was the average of of the GROSS
(ticket sales) for each day of the week?
What was the minimum of the GROSS
(ticket sales) for each day of the week?
What was the total gross in the last two months of the year?
Which day and month had the highest maximum GROSS?
What was the average of of the GROSS
(ticket sales) for each day of the week?
Pivot tables allow you to drag and drop variables, and move data around efficiently
There’s no one right way to answer a question but here is one solution:
Drag DAY
to the Rows
field.
Drag GROSS
to Values
column
Right click on a data value in the table and change ‘Summarize Values By’ to Average
.
What was the average gross sales on Fridays in 2024?
Round answer to closest million and just report that as a one or two digit answer, e.g. 6 million.
The average gross sales on Fridays was ____
million.
Using the framework for the summary in Question 2, we can easily find the minimum or maximum for each weekday as well.
Which day had the had the lowest minimum GROSS in 2024?
What is the approximate total GROSS for the last two months of the 2024?
Round to the closest million, e.g. 453 million.
___
million dollars
When you are done, clear the slicer filter, select the slicer menu, and delete it.
Which day and month had the highest maximum GROSS
?
The highest maximum gross occured on a ___
(day of week) in ___
(month).
When you are done, clear the slicer filter, select the slicer menu, and delete it.
In HW 2 you will examine 3 different sets of data about diamonds.
The next two examples are similar to Question 3 and Question 4 in HW 2.
The point of these examples is to show you how to
count the number of observations by categories.
convert counts to percentages.
make simple changes to answer different questions.
We want to know how many diamonds in this dataset are classified as Colorless with Slight Inclusions.
Convert the Diamonds Data (Worksheet 2) to a table (Insert > Table)
Create a pivot table as shown
Values
fieldCount
shows the number of observations in each Color/Clarity combination.
How many diamonds in this dataset are classified as Colorless with Slight Inclusions?
After creating a table of counts, we can convert counts to other useful values to answer questions.
There are multiple ways to these same options.
One simple way:
Right-Click on any value within Pivot Table
Select ‘Show Values As’
Select option to answer your question
In the example table, we select % of Column Total to answer this question because of how it is oriented.
Question: What percent of Colorless Diamonds
have Slight Inclusions
? (Similar to Questions 3 and 4 in HW 2)
How many diamonds in this dataset are classified as Colorless with Slight Inclusions?
We can easily convert percentages without changing the pivot table.
We want want to know what percent of diamonds with Slight Inclusions
are Near colorless
.
Right-click on any value in the table.
In ‘Show Values As’ change % of Column Total
to % of Row Total
Examine the table to confirm that it is correctly set up to answer our question.
What percent of diamonds with slight inclusions are Near colorless
?
A short demo of some key aspects of HW Assignment 2
Preview of the R and RStudio environment using Posit Cloud.
This requires that you create free a Posit Cloud account.
Pivot Tables
Pivot Tables with Slicers
Caution
HW 2 is due Monday, 1/27/25
To submit an Engagement Question or Comment about material from Lecture 4: Submit it by midnight today (day of lecture).