Column() returns the value found in the column corresponding to ColumnNo in a straight table, disregarding dimensions. For example Column(2) returns the value of the second measure column.
Return data type: dual
ColumnNo: Column number of a column in the table containing a measure. Information noteThe Column() function disregards dimension columns.
Sorting on y-values in charts or sorting by expression columns in tables is not allowed when this chart function is used in any of the chart's expressions. These sort alternatives are therefore automatically disabled. When you use this chart function in a visualization or table, the sorting of the visualization will revert back to the sorted input to this function.
If ColumnNo references a column for which there is no measure, a NULL value is returned.
Recursive calls will return NULL.
Examples and results:
Order Value is added to the table as a measure with the expression: Sum(UnitPrice*UnitSales).
Total Sales Value is added as a measure with the expression: Sum(TOTAL UnitPrice*UnitSales)
% Sales is added as a measure with the expression 100*Column(1)/Column(2)
The result of Column(1) is taken from the column Order Value, because this is the first measure column.
The result of Column(2) is taken from Total Sales Value, because this is the second measure column.
See the results in the column % Sales in the example Percentage total sales.
Make the selection Customer A.
|The selection changes the Total Sales Value, and therefore the %Sales. See the example Percentage of sales for selected customer.|
|Customer||Product||UnitPrice||UnitSales||Order Value||Total Sales Value||% Sales|
Data used in examples:
LOAD * inline [
] (delimiter is '|');