RANK
Applies to PredictiveInsight only.
Syntax
RANK(data [, nbins])
Parameters
data
This can be a constant value, a column, a cell range, or an expression evaluating to any of the above.
nbins
The number of bins which the data will be decided into. The default value is ten.
Description
RANK divides data into nbins (default 10) groups, each with approximately an equal number of distinct values, and returns the group into which each row of data falls. The output will be between 1 and nbins; if the number of distinct values of data is less than nbins, the output will be between 1 and the number of distinct values of data.
RANK silently imposes an upper bound of 1024*1024 on the value of nbins. That same number is also used as a maximum number of distinct values to track; subsequent distinct values will be included in the highest bin.
Examples
Creates three new columns named TEMP, VX, and VY. TEMP contains three copies of column V1, VX contains three copies of column V2, and VY contains three copies of column V3. Any uneven length columns are padded to the length of the longest column of V1 - V3.
Creates two new columns named TEMP and VX. The values in column TEMP are 10 copies of rows 10-50 of column V1, and the values in column VX are 10 copies of rows 10-50 of column V2.
Creates one new column named TEMP, containing the cell values 10, 20, 20, 30, 30, 30.
Creates one new column named TEMP. The value in cell V2[1] is repeated V1[1] times, the value in cell V2[2] is repeated V1[2] times, and so on until the end of column V1.
Creates two new columns named TEMP and VX. The TEMP column contains copies of cells in V2; the VX column contains copies of cells in V3. There are V1[1] copies of V2[1] and V3[1], V1[2] copies of V2[2] and V3[2]. This continues until the end of column V1 or the end of the longest column in data, which ever is shorter. Shorter columns in data are padded with zeros.
Creates three new columns named TEMP, VX, and VY, each a copy of column V1.
Creates four new columns named TEMP, VX, VY, and VZ. Column TEMP is a copy of column V1; column VX is a copy of column V2, column VY is a copy of column V1; and column VZ is a copy of column V2.