Reduce Columns
Reduce worksheet by merging or deleting columns
Minimum Origin Version Required: 9.1 SR0
1. wreducecols method:=merge ncols:=2 merge:=ave start:=3; //From the third column, every two columns merge their data points into the average of them.
2. wreducecols start:=2 end:=9 ow:=[<new>]<new>; //Specify the starting column and end column to delete, and output the result in a new book new sheet.
3. wreducecols -r 1 method:=mergeByLabels labelName:="Long Name" merge:=sum end:=4 ow:=<new>;
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 |
|---|---|---|---|---|
| Input Worksheet | iw |
Input Worksheet |
|
Specifies the input data range. |
| Reduce Method | method |
Input int |
|
Specifies the reduce method.
Option list:
|
| Label Row | labelName |
Input string |
|
Available only when method = mergeByLabels. Specify the column label row used to merge columns |
| Merge/Delete Columns | ncols |
Input int |
|
Specifies how many columns to merge or delete. This option is only available when select Delete N columns, then skip M columns or Reduce N columns with merged values as Reduce Method. |
| Skip Columns | skip |
Input int |
|
Specifies how many columns to skip. This option is only available when select Delete N columns, then skip M columns as Reduce Method. |
| Merge by | merge |
Input int |
|
Specifies the value to replace the merged data points. This option is only available when Reduce Method is set to Reduce N columns with merged values or Merge by Column Labels. Option list:
|
| Custom | custom |
Input int |
|
Available only when the data points are merged by Custom. You can specify multiple values in this variable. |
| Starting Column to Merge/Delete | start |
Input int |
|
Specifies the starting column to merge/delete. |
| End Column to Merge/Delete | end |
Input int |
|
Specifies the end column to merge/delete. Script accessible only. |
| Output Worksheet | ow |
Output Worksheet |
|
Specifies the output worksheet. See the syntax here. |
This X-Function is used to delete columns or merge columns with specified statistics data.
wreducerows, reducerows, wdelrows
Keywords:data reduction