ADDSLICEAXISATTRIBUTESORT

This function modifies an existing slice axis with the addition of sorting by attribute. To add sorting to a slice, use the modified axis when you create a slice definition.

These functions have a similar purpose:

  • ADDSLICEAXISATTRIBUTESORT
  • INSERTSLICEAXISATTRIBUTESORT

The difference between the two functions is in the order in which they add sorting criteria to the MDX definition of a slice. The order in which criteria are added determines the order in which they are applied and can, therefore, affect how a slice is sorted.

ADDSLICEAXISATTRIBUTESORT adds sorting to the end of the list of criteria. INSERTSLICEAXISATTRIBUTESORT adds sorting to the beginning of the list of criteria.

Syntax

=ADDSLICEAXISATTRIBUTESORT("axis","hierarchy","attribute","break_ hierarchy","order")

The function returns #{Axis}.

Example

In this example, cell F22 holds the result of a CREATESLICEAXIS function:

=ADDSLICEAXISATTRIBUTESORT(F22,"[Product]","member_caption","True","Desc")

Sorting is by Attribute1. True specifies that the hierarchy is broken and Desc that it is sorted in descending order.