Skip to main content
Skip table of contents

Rank

Returns the one-based rank of a specified tuple in a specified set.

Syntax

CODE
Rank(Tuple_Expression, Set_Expression [ ,Numeric Expression ] )

Arguments

Tuple_Expression

A valid Multidimensional Expressions (MDX) expression that returns a tuple.

Set_ExpressionA valid Multidimensional Expressions (MDX) expression that returns a set.
Numeric_ExpressionA valid numeric expression that is typically a Multidimensional Expressions (MDX) expression of cell coordinates that return a number.

Examples

In the example below gives a number from 24 to 0 starting from the current date's month descending until 24 months ago. All the rest members give value 0. 

CODE
Rank(
  [Time].CurrentHierarchyMember,
  Filter(
    [Time].CurrentHierarchyMember.Level.Members,
    DateBetween(
      [Time].CurrentHierarchyMember.StartDate,
      '24 months ago','today'
         )
    )
)


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.