# 2.2.3.11 colsplit

## Brief Information

Split column(s) into multiple columns by row index grouping

Minimum Origin Version Required:2015 SR1

## Command Line Usage

 1. colsplit irng:=col(A) nrows:=3; 

2. colsplit irng:=col(B) method:=seq nrows:=10; 

3. colsplit irng:=[Book1]Sheet1!(1,2); 

## Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Column(s) to be Split irng

Input

Range

<active>

Specify the input data range, should be one or multiple data column(s).

Subgroup Method method

Input

int

0

Choose a method to subgroup, works together with the nrows variable (i.e. N will be the value defined by nrows).

Option list:

• every:By Every Nth Row{0}
Every Nth row will be considered as a group. For example, if nrows is 3, there would be 3 groups, the first group has the data from rows 1, 4, 7 ... 1 + 3 * M, the second group has the data from rows 2, 5, 8, ... 2 + 3 * M, and so on.
• seq:By Sequential N Rows{1}
The sequential N rows will be considered as a group. For example, if nrows is 5, the data from row 1 to row 5 will be the first group, from row 6 to 10 will be second group, and so on.
• ref:By Reference Column{2}
Rows will be grouped accroding to reference column (ref variable) and split method (split variable) specified by user.
N nrows

Input

int

2

Specify the N value used in method variable. Based on the subgroup method chosen (method variable), it has different meanings.

Reference Column ref

Input

Column

<unassigned>

Specify the Reference Column when method variable is set to By Reference Column(ref).

Split split

Input

int

0

Specify the split method when method variable is set to By Reference Column(ref).

Option list:

• sep:By Separator{0}
Specify a separator in the reference column to split the source column into multiple columns.
• int:By Interval{1}
Specify the start value and interval to divide the ranges, the data within same range will be a subgroup.
Separator Value sep

Input

string

<Blank or Missing>

Specify the separator when split by separator.

Rows Meet Condition match

Input

int

0

Specify the meet condition when split by separator.

Option list:

• remove:Remove{0}
Each row with separator will be removed from output result.
• begin:Begin of New Block{1}
Each row with separator will be the head of new block.
• end:End of Current Block{2}
Each row with separator will be the tail of current block.
Treat Consecutive Rows as One consecutive

Input

int

0

Specify whether to treat consecutive rows as one in meet condition.

Interval interval

Input

double

2

Specify the interval value when split by interval.

Start Value start

Input

double

0

Specify the start value when split by interval.

Sort by Reference sort

Input

int

0

Specify whether to sort each group by value of reference column in output result when split by interval.

Output rd

Output

ReportData

[<input>]<new>

Specify where to output the result, see syntax here.

## Description

The concept of this X-Function is similar to wunstackcol, but the grouping is based on row indices or specified reference column.