Presentation is loading. Please wait.

Presentation is loading. Please wait.

CEE 3804: Computer Applications Databases and Pivot Tables Dr. Trani.

Similar presentations


Presentation on theme: "CEE 3804: Computer Applications Databases and Pivot Tables Dr. Trani."— Presentation transcript:

1 CEE 3804: Computer Applications Databases and Pivot Tables Dr. Trani

2 Spring 2013 CEE 3804 Slide 2 1. Topics to be Covered zDatabase functions zPivot tables: xBasics xPivot table reports

3 Spring 2013 CEE 3804 Slide 3 Database Functions a. Overview zFunctions that provide pivot table functionality zDfunction( database,field,criteria ): xdatabase: range of cells that make up the data xfield: name of field to perform operation xcriteria: range of cells that hold the criteria you want to hold with

4 Spring 2013 CEE 3804 Slide 4 Database Functions b. List of Functions zThe list functions include the following: xDAVERAGE(), DCOUNT(), DCOUNTA(), DGET(), DMAX(), DMIN(), DPRODUCT(), DSTDDEV(), DSTDDEVP(), DSUM(), DVAR(), and DVARP(). xWhere: DCOUNTA(): Returns the count of nonblank records DGET(): Returns the value of a specified field for a single matching record zExample: xUse the Cardata file on the course notes

5 Spring 2013 CEE 3804 Slide 5 Database Example (Cardata.xls) The syllabus has a file with car data. Name the file Cardata.xls

6 Spring 2013 CEE 3804 Slide 6 Database Example (Cardata.xls) zCreate a separate section in the worksheet where the query will be done zCopy the sequence of titles to help you guide the query (see below)

7 Spring 2013 CEE 3804 Slide 7 Database Example (Cardata.xls) zSuppose we want to count the number of cars whose weight > 3000 lbs Dcount(A1:H117, Weight,J6:Q7) Database rangeDatabase fieldCriteria

8 Spring 2013 CEE 3804 Slide 8 Database Example (Cardata.xls) zRead the solution from the cell containing the database query zNote that 50 cars weigh more than 3,000 lbs

9 Spring 2013 CEE 3804 Slide 9 Database Example (Cardata.xls) zA variation to specify the database field zDcount(A1:H117,4,J6:Q7) Database range Database field Column format Criteria

10 Spring 2013 CEE 3804 Slide 10 Database Example (Cardata.xls) zA variation to specify the database range zDcount(Cars,4,J6:Q7) Database range Variable format Database field Column format Criteria

11 Spring 2013 CEE 3804 Slide 11 Database Example (Cardata.xls) zCount the number of cars made in Japan whose weight > 2,700 lbs zVerify using the regular filters in Excel zGive it a try

12 Spring 2013 CEE 3804 Slide 12 Database Example (Cardata.xls) zCount the number of Sporty cars whose horsepower falls between 150 and 200 HP zThis requires two sets of conditions for one variable (Horsepower)

13 Spring 2013 CEE 3804 Slide 13 Pivot Tables a. Overview zA Pivot Table is a powerful data-analysis tool that Excel offers zPivot Tables summarize data in several fields: xdata field xrow field xcolumn field

14 Spring 2013 CEE 3804 Slide 14 Pivot Tables b. Demonstration Example

15 Spring 2013 CEE 3804 Slide 15 Pivot Tables c. Creating Pivot Tables zThere are four steps to creating a pivot table: xSpecify the type of source list to use for the pivot table xIdentify the location of the data xDefine row, column, values, and filters fields for the table xSelect a location, name, and other options of the table Filter Field Row Field Row Items Column Field Data Area Data Field

16 Spring 2013 CEE 3804 Slide 16 Pivot Tables d. Data List or Table zData list/table can be: xExcel list or table on a worksheet xA separate database file in Access, FoxPro, etc. xA collection of lists with row and column labels in one or more worksheets xAnother pivot table zAn Excel data table must have labeled columns

17 Spring 2013 Practice Pivot Tables zRetrieve the file called Construction_assets_cat.xls from the web site CEE 3804 Slide 17

18 Spring 2013 CEE 3804 Slide 18 Excel Pivot Table Example zFile contains the Caterpillar vehicles owned by a construction company zThree construction sites zThree types of vehicles (CAT 160H, CAT 725 and CAT 775F) zMileage, value and status (active or not) are attributes contained in the data set

19 Spring 2013 Pivot Table in Excel Ribbon (2013) CEE 3804 Slide 19

20 Spring 2013 CEE 3804 Slide 20 Customizing Pivot Tables a. Specifying the Layout of a Pivot Table zThe PivotTable toolbar simplifies the customizing of the pivot table: xenable/disable element selection xchange row/column/page/data Pivot Table Fields Areas to Build Pivot Table

21 Spring 2013 Building the Pivot Table (Excel 2013) zStart by selecting from the Pivot Table fields CEE 3804 Slide 21 Pivot Table is Built in the same Spreadsheet Construction Site Variable gets added To Row Pivot Area Adding a data field Starts the process

22 Spring 2013 Building the Pivot Table (Excel 2013) zAdding more variables starts making the Pivot Table more useful CEE 3804 Slide 22 A second set of rows Is added to existing ones Vehicle is added to the Area Adding a second data field (Vehicle)

23 Spring 2013 Building the Pivot Table (Excel 2013) zAdding a numeric variable summarizes the data based on the Values field CEE 3804 Slide 23 Vehicle is added to the Area Adding a numeric data field (Miles)

24 Spring 2013 Building the Pivot Table (Excel 2013) zYou can change the summary in the Value area CEE 3804 Slide 24 Change the Sum of Miles To Average Miles

25 Spring 2013 CEE 3804 Slide 25 Customizing Pivot Tables d. Changing Excel s Value/Data Field Summary zEleven summary functions: Sum: totals the values Count: Counts the values Average: Computes the average Max: Computes the largest value Min: Returns the smallest value Product: Computes the product of the values Count Nums: Counts the number of numeric data StdDev: Computes the standard deviation of the data StdDevp: Computes the standard deviation for a population Var and Varp: Computes the variance

26 Spring 2013 CEE 3804 Slide 26 Customizing Pivot Tables b. Changing Fields (Use your Imagination) Option 1: Option 2:

27 Spring 2013 CEE 3804 Slide 27 Customizing Pivot Tables c. Adding Filters zAdding categorical fields (non- numeric) to the Filter area allows you to execute quick filters Categorical fields Are good filters Adding the Status Variable To be used as filter Apply the filter using this pull down menu

28 Spring 2013 CEE 3804 Slide 28 Customizing Pivot Tables c. Adding Filters zAdding categorical fields (non- numeric) to the Filter area allows you to execute quick filters Status field is Used as filter Selected Active Vehicles

29 Spring 2013 CEE 3804 Slide 29 Customizing Pivot Tables c. Adding Pivot Charts zYou can also build Pivot Tables and Pivot Charts at the same time

30 Spring 2013 CEE 3804 Slide 30 Customizing Pivot Tables c. Adding Pivot Charts zBuilding Pivot Tables and Pivot Charts in one step zSelect the icon in the Insert Tab zThe following steps are the same as those used to create a Pivot Table

31 Spring 2013 CEE 3804 Slide 31 Customizing Pivot Tables c. Filtering on the Fly in Pivot Charts zYou can apply filters to Pivot Charts Filter leaves out Cat 775F vehicles

32 Spring 2013 CEE 3804 Slide 32 Customizing Pivot Tables e. Calculation Types zExcel can perform a number of calculations: xDifference from, % Of, % Difference From, Running Total in, % of row, % of column, % of total, Index Percent Difference from East RegionPercent of Row

33 Spring 2013 CEE 3804 Slide 33 Pivot Tables in Excel 2010 zLook under Insert pull-down menu Pivot Table information

34 Spring 2013 CEE 3804 Slide 34 Example in Excel 2010 zRetrieve the file called Construction_assets_cat.xls from the web site

35 Spring 2013 CEE 3804 Slide 35 Creating Pivot Table (Excel 2007/2010)

36 Spring 2013 CEE 3804 Slide 36 Creating Pivot Table (Excel 2007/2010) Pivot Table Builder Panel

37 Spring 2013 CEE 3804 Slide 37 Adding Elements to the Pivot Table (Excel 2007)

38 Spring 2013 CEE 3804 Slide 38 Displaying Summaries in the Pivot Table (Excel 2007/2010) Here we display the sum of the vehicle values for every type of vehicle and every location

39 Spring 2013 CEE 3804 Slide 39 Finding the Average Value of Vehicles in the Fleet (Excel 2007/2010)

40 Spring 2013 CEE 3804 Slide 40 Finding the Average Value of Vehicles (Excel 2007/2010)

41 Spring 2013 CEE 3804 Slide 41 Try Other Formats of Your Own


Download ppt "CEE 3804: Computer Applications Databases and Pivot Tables Dr. Trani."

Similar presentations


Ads by Google