INSERTSLICEAXISATTRIBUTESORT
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 value of the attribute parameter can be an attribute name or
member_caption
, which sorts elements by their captions.
The value of the order parameter can be Desc
or Asc
to sort in descending or ascending 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.