2.2.3.74 wunstackcol

Menu Information

Restructure: Unstack Columns

Brief Information

Unstack data using group columns

Additional Information

Minimum Origin Version Required: 8.1 SR0, updated in 8.5.1

Command Line Usage

  1. wunstackcol irng1:=2 irng2:=1 missing:=1;
  2. wunstackcol irng1:=col(2) irng2:=col(1) nonstack:=1 other:=col(3);
  3. wunstackcol -r 2 irng1:=(3:5) irng2:=col(2) sort:=data pos:=udl label:=L;

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
Data to be Unstacked irng1

Input

Range

<active>
Specify the data to be unstacked.
Group Column(s) irng2

Input

Range

<unassigned>
Specify the data to be the group. Unstacking columns is in accordance with this group.
Include Other Column(s) nonstack

Input

int

0
Specify whether to include those non-unstack columns in the original sheet to the result sheet.
Other Column(s) other

Input

Range

<optional>
Specify the data range(s) which will be the non-unstack column(s) to output to the result sheet. It is available when Include Other Column(s) is checked.
Extract Rule for Other Columns Values extract

Input

int

1
Specify how to arrange the data in Other Column(s).

Option list:

  • longest:Matching Longest Group
    This option is used in the situation when the unstacked data has the same structure in Group Column(s) and Other Column(s). Note that before using this option to unstack columns, the data should be sorted first by Group Columns then by Other Column(s).
  • combine:Combining All Groups
    This option is used in the situation when the combination of the data in Group Column(s) and the data in Other Column(s) is unique.
Include Missing as One Group missing

Input

int

0
Specify whether to consider missing values as one group.
Sort Output Coulmns By sort

Input

int

0
Specify how to sort the output columns.

Option list:

  • group:Group Variables
    Sort the output columns alphanumerically by group variable value. For example, group variable "Make" has two values, "Acura" and "Buick". After unstacking, the columns appear in the order "Acura", then "Buick".
  • data:Data to be Unstacked
    Preserve the order of the Data to be Unstacked. For example, Data to be Unstacked = [Book1]Sheet1!(3,4). When unstacked, column 3 data columns are listed first; column 4 data columns follow. If Data to be Unstacked = [Book1]Sheet1!(4,3), then column 4 data columns are listed first; column 3 data columns follow.
Output Worksheet ow

Output

Worksheet

<new>
Specify where to store the output unstacked results.
Put Grouping Info. to pos

Input

int

1
Specify where to put the grouping information.

Option list:

  • lname:Long Name
    Put the grouping information to the Long Name row.
  • comments:Comments
    Put the grouping information to the Comments row.
  • append:Append to Data Column's Long Name
    Append the grouping information to the Long Name row.
  • udl:User Defined Parameters
    Put the grouping information to the user defined parameter row, this row's name is specified by From Group Columns.
From Group Columns label

Input

string

<unassigned>
This drop-down list is only available when Put Group Info. to is set as User Defined Parameters. It is used to name the user defined parameter row for storing grouping information. The name is from the label row of the Group column in the source worksheet. The selected label row must contain a string for naming the user defined parameter row, or there will be an error message. Please refer to Column Label Row Characters for the single character to specify a label row.

Related X-Functions

wstackcol, colsplit

More Information

Please refer to this page in the User Guide for more information.

  • How to Unstack Columns
  • Example