columnSort

Specifies how to sort data values for members on the column axis.

Syntax

columnSort=sortString

where:

Argument Default Description
column none A column in a relational result set.
ascending none Specify true to sort ascending; false to sort descending.
tuple none The tuple on the column axis that specifies the column to be sorted.
dimension none The dimension on the row axis for which grouping is preserved. Specify null to indicate no grouping is to be preserved on the row axis.
preserveHierarchy false Specify true to preserve the hierarchy in the row axis, keeping members with their parents after the sort operation; false to not preserve hierarchy.
sortString none A comma-delimited string in one of the following formats:
  • tupleIndex, direction
  • tupleIndex, groupingNestLevel, direction
  • tupleIndex, groupingNestLevel, direction, preserveHierarchy

tupleIndex —string representation of an integer, representing the zero-based tuple index member (column) to sort, where 0 indicates the leftmost column.

groupingNestLevel —string representation of an integer, representing the dimension on the row axis for which grouping is preserved. For example, if Product and Market are on the row axis, a value of 1 sorts into sequence within the Market dimension. Specify -1 to sort without regard to row groupings. The default is -1.

direction —a case-insensitive string of either "Ascending", "Asc", "Descending" or "Desc".

preserveHierarchy —string representation of a boolean. see the preserveHierarchy argument. Defaults to false.

For example:

setcolumnSort("1,0,asc,true");
setcolumnSort("1,0,asc");
setcolumnSort("0,descending");

Usage

The getcolumnSort method returns a string of four comma-separated items: tupleIndex, groupingNestLevel, direction, and preserveHierarchy.

The following screen shots show the results of an ascending sort operation on the Qtr1 column depending on 1) whether the hierarchy is preserved , and 2) whether the grouping within the a specified level/dimension is preserved. The first example preserves the hierarchy in the Market dimension, yet not the grouping within the Product dimension.

Shows the hierarchy in the Market dimension. However, does not include grouping within the Product dimension.

The following example preserves neither the hierarchy in the Market dimension nor the grouping in the Product dimension.

Does not include grouping in the Product dimension, nor hierarchy in the Market dimension.

Examples

The following example demonstrates the use of the columnSort tag attribute:

columnSort="1, 0, asc"
Related reference
rowSort