SELECT
Applies to PredictiveInsight only.
Syntax
SELECT(col_nums, data) SELECT(from_col, data) SELECT(from_col, to_col, data)
Parameters
col_nums
The name of a column containing the column numbers to extract from the specified data range (for example, a column containing the numbers 1, 3, 4, and 7 would extract the first, third, fourth, and seventh column from the specified data range). This can be a constant value, a column, a cell range, or an expression evaluating to any of the above. For the format definition of col_nums (same as data), see the "Macro Function Parameters" section in the chapter in this guide for your IBM® Unica® product.
from_col
The numerical position of the column to extract from the specified data range. A value of one extracts the first column of a specified data range.
to_col
If this parameter is provided, from_col is used as a starting point and must be a column or a cell range. The ending point is specified by to_col. This value must be larger than from_col.
data
The cell range containing the column(s) to extract. This can be a constant value, a column, a cell range, or an expression evaluating to any of the above. For the format definition of data, see the "Macro Function Parameters" section in the chapter in this guide for your IBM® Unica® product.
Description
SELECT returns the specified columns from a data range. The columns to select can be specified in different ways. The col_nums parameter contains column numbers to extract from the specified data range. to extract a single column, use from_col. To extract a consecutive range of columns, specify from_col as a starting point (it must be a column or a cell range) and to_col as an ending column.
If data is scalar (that is, a constant or a variable containing a single value), selecting the first column returns a new column containing that constant. Selecting any other column from a constant returns a column containing ???.
This macro is often embedded into more complex functions.
*
To extract multiple non-adjacent columns, use the COLUMN macro function to create a column containing the column numbers to select. See the examples below.
Examples
Creates a new column named TEMP containing the number three.
TEMP = SELECT(1, V1) or TEMP = SELECT(1, V1:V3)
Creates a new column named TEMP, which is a copy of column V1.
Creates three new columns named TEMP, VX, and VY. TEMP is a copy of column V2, VX is a copy of column V3, and VY is a copy of column V4.
Creates two new columns named TEMP and VX. TEMP is a copy of column V6, and VX is a copy of column V9.
Creates two new columns named TEMP and VX, each containing 50 values. TEMP is a copy of cells 25-74 of column V6, and VX is a copy of cells 25-74 of column V9. The other cells in TEMP are empty.
Related Functions