Restructure: Pivot Table
Create pivot table to summarize worksheet data
Minimum Origin Version Required: Origin 2015 SR0
wpivot row:=col(4) col:=col(6) data:=col(11) method:=sum total:=1 sort_total:=descend sum:=1;
wpivot row:=(col(4):col(5)) col:=col(8) data:=col(9) method:=sum total:=1 sort_total:=no sum:=1 sort_col:=des;
wpivot row:=(col(4),col(6)) col:=col(8) method:=count dir:=col vmode:=limitValTotal threshold:=3;
Please refer to the page for additional option switches when accessing the x-function from script
Display Name |
Variable Name |
I/O and Type |
Default Value |
Description |
---|---|---|---|---|
Pivot Table Row Source | row |
Input Range |
|
Specify the range that will be used as the row source of the Pivot Table. Every distinct value of the selected range will correspond to a row in the pivot table. For example, if the table row source contains 5 cells and the values are "East", "South", "West", "South" and "East", there will be 3 rows in the pivot table. To do this analysis, you must active or specify at least 1 column for the row source.
There are three popular options:
|
Pivot Table Column Source | col |
Input Range |
|
Specify the range that will be used as the column source of the Pivot Table. Every distinct value of the selected range will correspond to a column in the pivot table. To do this analysis, you must specify at least 1 column for the column source. Options syntax follows Pivot Table Row Source. |
Pivot Table Data Source | data |
Input Range |
|
This is available only when Count is not selected for Summarize by (the Method variable). It provides the data values to be summarized. |
Summarize by | method |
Input int |
|
Specify the way to summarize the data.
Option list:
|
Combine Direction | dir |
Input int |
|
This variable defines whether to combine the count/sum/mean/min/max for smaller values into an "others" column/row.
|
Mode | vmode |
Input int |
|
Specify the mode for qualifying smaller values. This option applies only when dir is set to Column (1) or Row (2).
|
Reference Row/Col | refrow |
Input string |
|
Specify the reference row/column when either By Percent of Reference Row/Column or Top N of Reference Row/Column is selected for Mode. |
Threshold | threshold |
Input double |
|
Specify the percent or number for merging smaller values when either By Percent of Grand Total or By Percent of Reference Row/Column is selected for Mode |
Value Label | label |
Input string |
|
Specify the label for the column/row which is formed by merging the smaller value columns/rows. |
Totals for Rows | total |
Input int |
|
Specify whether to add a Row Total column. Each cell in this column contains the sum of the data in the same row. |
Sort Output Rows | sort_total |
Input int |
|
Specify the method used to sort the rows in the pivot table.
Option list:
|
Totals for Columns | sum |
Input int |
|
Specify whether to add a Column Total row. Each cell in this row contains the sum of the data in the same column. |
Sort Output Columns | sort_col |
Input int |
|
Specify the method used to sort the columns in the pivot table.
Option list:
|
Normalize by Column Totals | normalize |
Input int |
|
Specify whether to normalize the output data by the Column Totals.
Option list:
|
Show Zeros when Empty | zero |
Input int |
|
Specify whether to show missing values in the pivot table as zeros. |
Row Source Extra Values | exrow |
Input string |
|
' character. This is useful when you must have a standard report, but your data does not include some values. |
Column Source Extra Values | excol |
Input string |
|
' character. This is useful when you must have a standard report, but your data does not include some values. |
Put Column Info. to | pos |
Input int |
|
Specify where to output column source info in Pivot Table.
Options List
|
From Column | udlabel |
Input string |
<unassigned> |
Specify the identifier of the pivot table column label row. Available only when pos:=3 or udl. Option list:
<custom> corresponds to the name of user defined parameters. |
Output Result Table to | rd |
Output ReportData |
|
Specify where to output result table. |
This X-Function allows you to specify two or more columns to create a pivot table to visualize data summarization by a number of options including statistics of a third column.
About the detail examples, please refer to the Pivot Table tutorial page.