Descendants

Return to: Calculated Member Builder Function List

Returns the set of descendants of a member at a specified level, optionally including or excluding descendants in other levels.

Syntax

Descendants(«Member», «Level»[, «Desc_flag»])

Flags
Flag Description
SELF Default. Returns descendant members from «Level» only. Includes «Member», if and only if «Level» specified is the level of «Member».
AFTER Returns descendant members from all levels subordinate to «Level».
BEFORE Returns descendant members from all levels between «Member» and «Level», not including members from «Level».
BEFORE_AND_AFTER Returns descendant members from all levels subordinate to the level of «Member» except members from «Level».
SELF_AND_AFTER Returns descendant members from «Level» and all levels subordinate to «Level».
SELF_AND_BEFORE Returns descendant members from «Level» and all levels between «Member» and «Level».
SELF_BEFORE_AFTER Returns descendant members from all levels subordinate to the level of «Member».

Remarks

By default, only members at the specified level will be included. This function corresponds to a «Desc_flag» value of SELF. By changing the value of «Desc_flag», you can include or exclude descendants at «Level», the children before «Level», and the children after «Level» (until the leaf node).

Example

Assume levels are Countries, States, Counties, and Cities.

Function Returns
Descendants(USA, Counties) All counties in USA.
Descendants(USA, Counties, SELF) All counties in USA.
Descendants(USA, Counties, BEFORE) All states in USA.
Descendants(USA, Counties, AFTER) All cities in USA.
Descendants(USA, Counties, BEFORE_AND_AFTER) All states and cities in USA.
Descendants(USA, Counties, SELF_BEFORE_AFTER) All states, counties, and cities in USA.

(c) 1988-1998 Microsoft Corporation. All Rights Reserved.