Ancestors

Given the input member and a layer or distance, this function returns a set of ancestors along with the input member.

When the layer specification is a level, this function returns all ancestors having a level no greater than the input level. For example, Ancestors ([Additions], [Measures].Levels(2)) returns {[Inventory] , [Additions]}.

Syntax

Ancestors ( member , layer | index )
ParameterDescription

member

The member for which a set of ancestors is sought.

layer

Layer specification.

index

A number of hierarchical steps up from member, locating the highest ancestor you want returned in the result set.

Notes

Example

Ancestors ( [New York], [Market].levels(2) )

returns {[Market], [East], [New York]}, the self-inclusive set of [New York] ancestors beginning with the ancestor that is located at level 2 of the Market dimension.

Ancestors ( [Feb], 1 )

returns {[Qtr1],[Feb]}, the self-inclusive set of ancestors beginning with the ancestor one step higher than Feb.

Ancestors ( [Feb], 0 )

returns {[Feb]}.

Using the ASOSamp.Sample database,

Ancestors ([94089], [Geography].generations(2))

returns {[West], [CA], [SUNNYVALE - CA], [94089]}, the self-inclusive set of 94089 ancestors beginning with the second generation of the Geography dimension.