Skip to main content Skip to complementary content

ColumnNo - chart function

ColumnNo() returns the number of the current column within the current row segment in a pivot table. The first column is number 1.

Syntax:  

ColumnNo([total])

Arguments
Argument Description
TOTAL If the table is one-dimensional or if the qualifier TOTAL is used as argument, the current column segment is always equal to the entire column.

Defining the aggregation scope

If the pivot table has multiple horizontal dimensions, the current row segment will include only columns with the same values as the current column in all dimension rows except for the row showing the last horizontal dimension of the inter-field sort order. The inter-field sort order for horizontal dimensions in pivot tables is defined simply by the order of the dimensions from top to bottom.

Information noteSorting 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.
Example: Chart expression
Example Result
IF( ColumnNo()=1, 0, Sum(Sales) / Before(Sum(Sales))) Where the ColumnNo is equal to 1, the chart will return zero. Otherwise, it will return the result of Sum(Sales) / Before(Sum(Sales). In this example, the chart will return values from column 2 onwards, while column 1 will return zero.

Example - ColumnNo fundamentals

Example - ColumnNo scenario

Example - ColumnNo advanced scenario

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!