2.2.3.61 wreducecols

Menu Information

Reduce Columns

Brief Information

Reduce worksheet by merging or deleting columns

Additional Information

Minimum Origin Version Required: 9.1 SR0

Command Line Usage

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.

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.

X-Function Execution Options

Please refer to the page for additional option switches when accessing the x-function from script

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Input Worksheet iw

Input

Worksheet

<active>
Specifies the input data range.
Reduce Method method

Input

int

0
Specifies the reduce method.

Option list:

  • 0: del (Delete N columns, then skip M columns)
Delete N columns, then skip M columns
  • 1: merge (Reduce N columns with merged values)
Merge every N data points into one data point with specified value.
Merge/Delete Columns ncols

Input

int

2
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

1
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

0
Specifies the value to replace the merged data points.
This option is only available when select Reduce N columns with merged values as Reduce Method.

Option list:

  • first:First Point
Merges every N data points into the first data point of these data points.
  • last:Last Point
Merges every N data points into the last data point of these data points.
  • ave:Average
Merges every N data points into the average of these data points.
  • min:Min
Merges every N data points into the minimum value of these data points.
  • max:Max
Merges every N data points into the maximum value of these data points.
  • sum:Sum
Merges every N data points into the sum of these data points.
  • sd:SD
Merges every N data points into the standard derivation of these data points.
  • median:Median
Merges every N data points into the median of these data points.
  • custom:Custom
Merges every N data points into the specify the values of these data points. In the custom variable, you can specify multiple values.
Custom custom

Input

int

ave sd
When set the data points are merged by Custom, you can specify multiple values in this variable.
Starting Column to Merge/Delete start

Input

int

1
Specifies the starting column to merge/delete.
End Column to Merge/Delete end

Input

int

-1
Specifies the end column to merge/delete. Script accessible only.
Output ow

Output

Range

<input>
Specifies the output range. See the syntax here.

Description

This X-Function is used to delete columns or merge columns with specified statistics data.

Example

  1. Create a new workbook and import the Origin sample data Step01.dat which is located in <Origin Program Folder> \Samples\Curve Fitting.
  2. When the workbook is active, select menu item Worksheet: Reduce Columns to open wreducecols X-Function dialog. Set the options as below:
    Reduce Method: Delete N columns, then skip M columns
    Delete Columns: 1
    Skip Columns: 1
    Starting Columns to Delete: 4
    Output: <new>
  3. Click OK to delete the columns and the result will be output in a new sheet.

Related X-Functions

wreducerows, reducerows, wdelrows


Keywords:data reduction