Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Arranges members of a set, optionally preserving or breaking the hierarchy.

Syntax

 Order(Set_Expression, Value)
 Order(Set_Expression, Value, Symbol)

Arguments

Set_Expression
MDX expression that returns set.
Value
Value by which this set should be ordered
Symbol

ASC, DESC - orders ascending or descending within members hierarchy

BASC, BDESC - orders ascending or descending overriding members hierarchy

Examples

The following example would get all the invoices for the selected customer, would sort them by Invoice date, return the last invoice and show it's date.

Order(
Filter(
NonEmptyCrossJoin(
[Invoice].[Invoice].members,
[Customer].CurrentMember
),
NOT IsEmpty([Measures].[Invoice base amount])
),
[Invoice].CurrentMember.get('Invoice date'),
DESC
).Item(0).Item(0).get('Invoice date')
  • No labels