Given the input member, this function returns an ancestor at the specified layer.
Ancestor ( member , layer | index )
member | The member for which an ancestor is sought. |
layer | Layer specification. |
index | A number of hierarchical steps up from member, locating the ancestor you want returned. |
Ancestor([Qtr1], -1)
would return an empty member, not a descendant.The level number of a member = (highest level number among its children) + 1.
Therefore, Ancestor ([Measures].[Additions], [Measures].Levels(2))
returns an
empty member, because [Additions] does not have an ancestor with
level number 2.
Ancestor ( [New York], [Market].levels(2) )
returns the member[Market]
, which is the ancestor of[New York]
that is located at level 2 in the outline.
Ancestor ([Year].[Jan], [Year].generations(2))
returns the member[Qtr1]
, which is the ancestor ofJan
that is located in the second generation of the Year dimension.
Ancestor ( [Feb], 2 )
returns the member[Year]
, which is the grandparent ofFeb
.
Ancestor ( [Feb], 0 )
returns the member [Feb]. An "ancestor" that is zero steps away is considered to be the member itself.
©2004 Hyperion Solutions Corporation. All Rights Reserved. http://www.hyperion.com |