MDX - Rule Functions
  • 3 Minutes to read
  • Dark
    Light
  • PDF

MDX - Rule Functions

  • Dark
    Light
  • PDF

Article summary

The following table contains information on common rule functions. Functions are used in rule statements, queries, and other calculations. There are different types of rule functions based on the results you are trying to achieve; Level, Member, or Logical. The functions below are categorized by Time, Set, Statistical, and Navigation.

Time
Set
Statistical
Navigation

YTD - returns a set of sibling members from the same level as a given member, starting with the first sibling and ending with the given member, as constrained by the Year level in the Time dimension.

TopCount - sorts a set in descending order and returns the specified number of elements with the highest values.

CoalescEmpty - converts an empty cell value to a specified nonempty cell value, which can be either a number or string.

Ancestor - returns the ancestor of a specified member at a specified level or at a specified distance from the member.

QTD - returns a set of sibling members from the same level as a given member, starting with the first sibling and ending with the given member, as constrained by the Quarter level in the Time dimension.

BottomCount - sorts a set in ascending order, and returns the specified number of tuples in the specified set with the lowest values.

Count - returns the number of cells in a set.

Ancestors - returns the set of all ancestors of a specified member at a specified level or at a specified distance from the member.

MTD - returns a set of sibling members from the same level as a given member, starting with the first sibling and ending with the given member, as constrained by the Month level in the Time dimension.

Crossjoin - returns the cross product of one or more sets.

DistinctCount - returns the number of distinct, nonempty tuples in a set.

Ascendants - returns the set of the ascendants of a specified member, including the member itself.

ParallelPeriod - returns a member from a prior period in the same relative position as a specified member.

Descendants - returns the set of descendants of a member at a specified level or distance, optionally including or excluding descendants in other levels.

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

Children - returns the set of children of a specified member.

PeriodsToDate - returns a set of sibling members from the same level as a given member, starting with the first sibling and ending with the given member, as constrained by a specified level in the Time dimension

Distinct - evaluates a specified set, removes duplicate tuples from the set, and returns the resulting set.

 

Cousin - returns the child member with the same relative position under a parent member as the specified child member.

LastPeriods - returns a set of members up to and including a specified member.

Except - evaluates two sets and removes those tuples in the first set that also exist in the second set, optionally retaining duplicates.

 

Current - returns the current tuple from a set during iteration.

OpeningPeriod - returns the first sibling among the descendants of a specified level, optionally at a specified member.

Existing - forces a specified set to be evaluated within the current context.

 

FirstChild - returns the first child of a specified member.

ClosingPeriod - returns the member that is the last sibling among the descendants of a specified member at a specified level.

Exists - returns the set of tuples of the first set specified that are common to with one or more tuples of the second set specified.

 

FirstSibling - returns the first child of the parent of a member.

 

Extract - returns a set of tuples from extracted hierarchy elements.

 

IsAncestor - returns whether a specified member is an ancestor of another specified member.

 

Filter - returns the set that results from filtering a specified set based on a search condition.

 

IsGeneration - returns whether a specified member is in a specified generation.

 

Generate - applies a set to each member of another set, and then joins the resulting sets by union.

 

IsLeaf - returns whether a specified member is a leaf member.

 

Head - returns the first specified number of elements in a set, while retaining duplicates.

 

IsSibling - returns whether a specified member is a sibling of another specified member.

 

Hierarchize - orders the members of a set in a hierarchy.

 

Lag - returns the member that is a specified number of positions before a specified member at the member's level.

 

Intersect - returns the intersection of two input sets, optionally retaining duplicates.

 

LastChild - returns the last child of a specified member.

 

NonEmpty - returns the set of tuples that are not empty from a specified set, based on the cross product of the specified set with a second set.

 

LastSibling - returns the last child of the parent of a specified member.


Was this article helpful?