4.4.18 Pivot Table


Video Image.png See more related video:Pivot Table

A pivot table is a data summary tool commonly found in data-analysis software. The table is constructed by taking a dataset consisting of observations collected across a number of variables, picking two categorical variables of interest -- let's call them var1 and var2 -- then letting all possible values of var1 define rows in the table, and all possible values of var2 define columns in the table. Table cells would then contain values that result from the intersection of row and column values. A parallel of pivot table is a matrix, with the var1 as rows, var2 as columns, pivot table data as the elements of the matrix. By saving an analysis template with pivot table, you can quickly create similar data summary for different dataset. Origin's pivot table tool includes support for the following:

To open this tool:

  1. Click on the worksheet that you want to analyze.
  2. Click Restructure: Pivot Table... to open the wpivot dialog box.

The wpivot dialog uses the the wpivot X-Function.

Contents

Dialog Options

Pivot Table Dialog.png

Pivot Table Row Source

Specify the column range that will be used as the row source of the pivot table. Data in the source worksheet with the same name in row source range will be displayed as a single row in the pivot table.The following diagram illustrates the definition of row source. You can choose one or more data range as pivot table row source.

Pv rowresource.png

The following diagram illustrate the definition of multiple row source in pivot table.

Pv rowresourcemm.png

This part includes a display box and a toolbar with five buttons Group List Toolbar.png:

Display Box The selected column(s) will display in this box. To do this analysis, you must select at least 1 column for the row source.
Triangle Button for Select Button Group List Add.png Click this button then choose a column from menu, or click Select Columns to open the Column Browser and add column(s) to the Display Box as row source of pivot table. Click this button again to add another column as additional row source.
Remove button Button Group List Remove.png Remove the selected data range(s) from the Display Box. This button is available when you select one or more selected column(s) in the box.
Move Up button Button Group List Move Up.png Move the selected data range(s) up in the Display Box. Use this button to order the row source columns and the pivot table results will follow this order.
Move Down button Button Group List Move Down.png Move the selected data range(s) down in the Display Box. Use this button to order the row source columns and the pivot table results will follow this order.
Select All button Button Group List Select All.png Select all data range(s) down in the Display Box.

Pivot Table Column Source

Specify the column range that will be used as the column source of the pivot table. Data in the source worksheet with the same name in column source range will be displayed as a single row in the pivot table. The following diagram illustrate the definition of column source. It should be noted that the column information can be designated into other column label rows. You can choose one or more data range as pivot table column source. The column source arrangement in the pivot table would be similar to those of row source.

Pv column resource.png

Note:
  1. This part includes a display box and a toolbar with five buttons Group List Toolbar.png.To know more about the controls, please refer to the table under the Pivot Table Row Source section.
  2. The value of Column Source has been put into the Comments column label row by default; in fact, it can be also put into other column label rows, such as Long Name by configuring the Put Column Info. to drop-down list of Options.

Pivot Table Data Source

This is available only when Count is not selected for Summarize by (the Method variable). These are the data values to be summarized from one dimension column into two dimension matrix-like pivot table.


The way data arranged in pivot table is similar when summarizing data by Max Min, Mean or Sum. The following screenshot is an example to summarize data by Sum
Pv data.png
In the following example, the total cost data of cell (2001, Bikes) is the sum of those cells in Column TotalCost with criteria as follow: ProductCategory as Bikes, and YEAR as 2001.
Pv data1.png
On the contrary, if Count is selected in the Summarized by drop-down list, the table would only fill in the count number that simultaneously meeting its cell position that related row resource and column resource.

Combine Smaller Values

Combine Smaller Values allows smaller values to be combined into an "Other" category so as to have fewer final categories to be displayed. More details can refer to the example below.



Note: Once Mode is selected, you can also specify other supplementary options, such as Percent, Reference Row/Column Value, Top N, and Column/Row Label, beneath the Mode drop-down list, which would change according to the selected mode.
Combine-PVT1.png
To change the default name of the reduced category, specify the new name in Row(or Column) Label in the beneath Mode drop-down list. In the following screenshot, the default name of the reduced category has been renamed as Other Smaller Item and other categories with smaller percentages has been reduced into this category.
Combine-PVT2.png

Options


Row label ac222e.png
Row label ac.png

Suppose you have the following dataset(See source worksheet in the screenshot below). It is sales summary of several products(Bike, Accessories,and Clothing) in different countries from year 2001 to year 2004. You want to create a summary presenting the total cost of different products on each year. You can specify YEAR as column category and Categories as row category. However, the sales record of Accessories and Clothing in 2001 and 2002 are missing. The following two situations display the different result of whether or not using Column Source Extra Values.

If using the worksheet query to display the data with Condition as: YEAR <= 2002, then create a pivot table of sum of total cost without specifying Column Extra Value based on the new extracted query data. The pivot table would exclude the category Accessories and Clothing, only displaying the category Bikes, which has extant data record of YEAR 2001 and 2002 in the source worksheet.
Pv filter 0.png
Pv filter 1.png
On the contrary, if creating a similar pivot table but specifying the Column Extra Value, the pivot table would display all three categories, despite of missing records. These two missing categories would be shown with zero sum.
Pv filter 2.png
Pv filter 3.png
Note:

Column Extra Value feature is extremely important when you are using the pivot table to plot a graph. In this situation, you might want all categories presented even if the records of some categories in source worksheet is not complete. Setting Column Extra Value would automatically treat the missing data as zero but still regard the related categories as data groups in the graph.

Pv filter 4.png

Output Result Table to

Specify where to output the result pivot table. Click the triangle button to specify output method.

[<input>]<input>: Input the pivot table into the current worksheet.

<new>: Put pivot table into a new sheet of the current workbook.

[<new>]<new>: Put pivot table into a new workbook.