Cee3804_databases_2015 (1)
Cee3804_databases_2015 (1)
❚ Database functions
❚ Pivot tables:
❘ Basics
❘ Pivot table reports
Spring 2015
CEE 3804 Slide 2
Database Functions
a. Overview
Spring 2015
CEE 3804 Slide 3
Database Functions
b. List of Functions
❚ Example:
❘ Use the Cardata file on the course notes
Spring 2015
CEE 3804 Slide 4
Database Example (Cardata.xls)
The syllabus has a file with car data. Name the file Cardata.xls
Spring 2015
CEE 3804 Slide 5
Database Example (Cardata.xls)
Spring 2015
CEE 3804 Slide 6
Database Example (Cardata.xls)
Spring 2015
CEE 3804 Slide 7
Database Example (Cardata.xls)
Spring 2015
CEE 3804 Slide 8
Database Example (Cardata.xls)
Criteria
Database field
Database range
Column format
Spring 2015
CEE 3804 Slide 9
Database Example (Cardata.xls)
Spring 2015
CEE 3804 Slide 10
Database Example (Cardata.xls)
❚ Give it a try
Spring 2015
CEE 3804 Slide 11
Database Example (Cardata.xls)
Spring 2015
CEE 3804 Slide 12
Pivot Tables
a. Overview
Spring 2015
CEE 3804 Slide 13
Pivot Tables
b. Demonstration Example
Region Quarter Sales Rep Sales
East 1st A 192,345
West 1st B 210,880
Regular table
East 1st C 185,223
South 1st D 165,778
Midwest 1st E 155,557
South 1st F 180,567
West 1st G 200,767
Midwest 1st H 165,663
East 2nd A 173,493
West 2nd B 200,203
East 2nd C 170,213
South 2nd D 155,339 Sales Rep (All)
Midwest 2nd E 148,990
South 2nd F 175,660 Sum of Sales Quarter
West 2nd G 190,290 Region 1st 2nd 3rd 4th Grand Total
South 2nd H 170,000
East 3rd A 145,800
East 377,568 343,706 320,800 303,955 1,346,029
West 3rd B 211,123 Midwest 321,220 148,990 147,900 150,000 768,110
East 3rd C 175,000 South 346,345 500,999 500,100 528,000 1,875,444
South 3rd D 150,000 West 411,647 390,493 400,023 370,980 1,573,143
Midwest 3rd E 147,900
Grand Total 1,456,780 1,384,188 1,368,823 1,352,935 5,562,726
South 3rd F 171,200
West 3rd G 188,900
South 3rd H 178,900
East 4th A 134,980
West
East
4th
4th
B
C
203,000
168,975
Pivot table
South 4th D 139,000
Midwest 4th E 150,000
South 4th F 200,000
West 4th G 167,980
South 4th H 189,000
Spring 2015
CEE 3804 Slide 14
Pivot Tables
c. Creating Pivot Tables
Spring 2015
CEE 3804 Slide 15
Pivot Tables
d. Data List or Table
Spring 2015
CEE 3804 Slide 16
Practice File for Pivot Tables
Spring 2015
CEE 3804 Slide 17
Excel Pivot Table Example
Spring 2015
CEE 3804 Slide 18
Pivot Table in Excel Ribbon (2013)
Spring 2015
CEE 3804 Slide 19
Customizing Pivot Tables
a. Specifying the Layout of a Pivot Table
Areas to Build
Pivot Table
Spring 2015
CEE 3804 Slide 20
Building the Pivot Table (Excel 2013)
❚ Start by selecting from the Pivot Table fields
Adding a data field
Starts the process
Pivot Table is
Built in the same
Spreadsheet
Construction Site
Variable gets added
To Row Pivot Area
Spring 2015
CEE 3804 Slide 21
Building the Pivot Table (Excel 2013)
❚ Adding more variables starts making the Pivot Table
more useful Adding a second
data field (Vehicle)
Vehicle is added
to the Area
Spring 2015
CEE 3804 Slide 22
Building the Pivot Table (Excel 2013)
❚ Adding a
numeric Adding a numeric
data field (Miles)
variable
summarizes
the data
based on the
Values field Vehicle is added
to the Area
Spring 2015
CEE 3804 Slide 23
Building the Pivot Table (Excel 2013)
❚ You can
change
the
summary
in the
Value
area
Change the Sum of Miles
To Average Miles
Spring 2015
CEE 3804 Slide 24
Customizing Pivot Tables
d. Changing Excel’s Value/Data Field Summary
Option 1:
Region 1st 2nd 3rd 4th Grand Total
East 377,568 343,706 320,800 303,955 1,346,029
Midwest 321,220 148,990 147,900 150,000 768,110
South 346,345 500,999 500,100 528,000 1,875,444
West 411,647 390,493 400,023 370,980 1,573,143
Grand Total 1,456,780 1,384,188 1,368,823 1,352,935 5,562,726
Option 2:
H 165,663 165,663
Midwest Total 321,220 148,990 147,900 150,000 768,110
South D 165,778 155,339 150,000 139,000 610,117
F 180,567 175,660 171,200 200,000 727,427
H 170,000 178,900 189,000 537,900
South Total 346,345 500,999 500,100 528,000 1,875,444
West B 210,880 200,203 211,123 203,000 825,206
G 200,767 190,290 188,900 167,980 747,937
West Total 411,647 390,493 400,023 370,980 1,573,143
Grand Total 1,456,780 1,384,188 1,368,823 1,352,935 5,562,726
Spring 2015
CEE 3804 Slide 26
Customizing Pivot Tables
c. Adding Filters
Adding the Status Variable
❚ Adding To be used as filter
categorical
fields (non-
numeric) to the
Filter area
allows you to
execute quick
filters
Apply the filter
using this pull Categorical fields
down menu Are good filters
Spring 2015
CEE 3804 Slide 27
Customizing Pivot Tables
c. Adding Filters
❚ Adding
categorical
fields (non-
numeric) to the
Filter area
allows you to
execute quick
filters
Selected “Active”
Vehicles Status field is
Used as filter
Spring 2015
CEE 3804 Slide 28
Customizing Pivot Tables
c. Adding Pivot Charts
❚ You can also build Pivot Tables and Pivot Charts at the
same time (Windows version of Excel)
Spring 2015
CEE 3804 Slide 29
Customizing Pivot Tables
c. Adding Pivot Charts
Spring 2015
CEE 3804 Slide 32
Pivot Tables in Excel 2011 for Mac
Spring 2015
CEE 3804 Slide 33
Pivot Tables in Excel 2011 for Mac (2)
Spring 2015
CEE 3804 Slide 35
Pivot Tables in Excel 2011 for Mac (4)
Spring 2015
CEE 3804 Slide 36
Pivot Tables in Excel 2011 for Mac (4)
❚ Add a graphical
depiction to the
Pivot Table
❚ Plot is done
manually on the
Mac
Spring 2015
CEE 3804 Slide 37
Pivot Tables in Excel 2010
Spring 2015
CEE 3804 Slide 38
Example in Excel 2010
Spring 2015
CEE 3804 Slide 39
Creating Pivot Table (Excel 2007/2010)
Spring 2015
CEE 3804 Slide 40
Creating Pivot Table (Excel 2007/2010)
Pivot Table
Builder Panel
Spring 2015
CEE 3804 Slide 41
Adding Elements to the Pivot Table
(Excel 2007)
Spring 2015
CEE 3804 Slide 42
Displaying Summaries in the Pivot Table
(Excel 2007/2010)
Spring 2015
CEE 3804 Slide 43
Finding the Average Value of Vehicles in
the Fleet (Excel 2007/2010)
Spring 2015
CEE 3804 Slide 44
Finding the Average Value of Vehicles
(Excel 2007/2010)
Spring 2015
CEE 3804 Slide 45
Try Other Formats of Your Own
Spring 2015
CEE 3804 Slide 46