Professional Documents
Culture Documents
Pop Group Pivot Tables Feb 05
Pop Group Pivot Tables Feb 05
POPGROUP output includes flat files, the results from one or more forecasts on a single excel sheet. These population forecasts and components of population change can be analysed with statistical packages or with Excel Pivot Tables. This document describes Pivot Tables and gives examples of their use with POPGROUP output files.
Contents
Pivot Tables an introduction..........................................................................3 Simple table 1...............................................................................................5 Simple table 2...............................................................................................6 Simple table 3...............................................................................................7 Simple table 4...............................................................................................8 Simple table 5...............................................................................................9 POPGROUP v3 and pivot tables ...................................................................10 Examples from POPGROUP output files .......................................................12 Example 1 ..................................................................................................12 Example 2 ..................................................................................................13 Example 3 ..................................................................................................14 Example 4 ..................................................................................................15 Useful sources of information on Pivot Tables...............................................17
Pivot tables require a definition of the fields that are going to be presented in the table. Up to four levels may be defined for the makeup of the table:
1. The page level: field(s) that the table will report on, appearing at the top of the pivot table page. For example, the table could report on the number of persons by age and sex in the population group that is
selected at the page level (Abba in the above illustration.) This level is optional, as will be seen in some of the examples that follow. 2. The row level: the field(s) that will appear as the rows of the table; for example, age groups. The age groups could be as produced in the POPGROUP dump file, or as a new set of age groups that are derived from the ages in the flat file. More than one row may be defined, in which case the rows of the subsidiary fields will be indented within the superior fields. Once the pivot table has been set up, and displayed, individual values of the row fields may easily be selected: for example, within age group one may wish to display only the 0 to 4 and 75+ age groups. 3. The column level: the field(s) that will appear as columns in the table: for example, sex. Again, more than one field may be chosen. Once the pivot table has been created, one may select any value within all those available within the field. 4. The data level: this is what is displayed within the body of the table: for example, the sum of migrants at each age group, within the chosen population group. This level is mandatory. One row level or one column level with the data level is the minimum requirement. Design of the pivot table becomes a central issue when determining which fields should be defined at the page level and which at the row and column level. If a number of row fields and column fields are defined the resulting table may be very unwieldy and difficult to interpret. There follows a set of simple tables that demonstrate the different types of table layout, produced from a sample flat file with just four fields population group, age, sex and number of persons.
Simple table 1
The page level is Population Group (called area in this example); Abba has been selected as the subject area of the report. Two row fields are defined as Sex and Age No column field is defined. The data field is of number of persons
Simple table 2
No page level defined Row fields are sex and age group Column field is population group Data field is sum of persons
Simple table 3
Page level is Population Group (Abba selected from the drop down list) Row level is age group Column level is sex Data level is sum of persons
Simple table 4
No page level defined Row level is age group Column levels are population group and sex Data level is sum of persons
Simple table 5
This table shows that the data displayed can be one of a number of types, not just sums or counts in this case as a percentage of another value. No page level defined Row level is age group Column levels are population group and sex Data level is percentage of column total
10
The flat file produced from a dump file is relatively straightforward, providing a limited number of values for each field. The components flat file contains a large number of possible stream values, and use of this file needs some careful thought about the combination of fields at page, row and column level to produce a pivot table for the required analysis. The types of analysis that are possible depend on the type of forecast that has been run; for example, if no constraints have been specified then clearly no pivot table that includes the constraint topic could be produced. A review of the components file from which the flat file was produced will determine what pivot tables are possible and useful.
11
12
Example 2
This example shows 3 page levels, with the table counting the number of persons for each measure (births, deaths etc) in each year, 1991 to 2002. The table is a summary of these measures for the County.
A new sheet appears with the resultant pivot table. Put the cursor on the grey Data cell and drag it to the cell containing the word Total for a proper crosstab. Reformat the table with an appropriate number format and font. Use the Page level variables to select All in Sex and All ages; select a population group. In the Topic row layer de-select Constraint. In this example, the Start Popn next year was generated by using Excel to sum the positive and negative flows.
13
Example 3
This example shows 3 page levels, in which have been chosen specific values for this table, births. The table sums all births in each population group for each chosen year.
A new sheet appears with the resultant pivot table. Put the cursor on the grey Data cell and drag it to the cell containing the word Total for a proper crosstab. Reformat the table with an appropriate number format and font. Use the Page level variables to select All in Sex, Flow in Rec_type and Births in Topic. In the Group row layer de-select County (the all groups sum produced by the POPGROUP forecast), so that the Grand Total is the sum of just the Countys Districts. Rename Grand Total to County (by overtyping).
14
Example 4
Example of a pivot table from a flat file produced by appending a series of components files generated from alternative scenarios
A new sheet appears with the resultant pivot table. Reformat the table with an appropriate number format and font. Use the Page level variables to select Deaths in Topic, All Deaths in Stream and a population group in Group.
15
By highlighting the pivot table, right clicking the mouse and selecting PivotChart, the following chart is automatically produced.
1250
1200
1150
1100
1050
1000
950
900
850
800 Sum of 1991 Sum of 1996 Sum of 2001 Data Sum of 2006 Sum of 2011 Sum of 2016
Once the chart has been produced, the standard Excel charting facilities may be used to change the formats, add titles, select minimum/maximum values to be displayed, etc.
NOTE: the V3 workbook Summ Comparison uses the Summ workbooks to produce a series of pivot tables and charts covering the components and population summaries of all, or a selected number of, the scenario results in POPGROUPs Output directory. See the user manual for further details of the Summ Comparison workbook.
16
17