Returns a member’s shared member along a given hierarchy.
This function can be used instead of passing hierarchy arguments to Parent, Ancestor, FirstSibling, and LastSibling functions. This function works well in conjunction with Is* functions such as IsAncestor, IsChild, IsSibling, IsLevel, IsGeneration, and IsLeaf.
Syntax
member.LinkMember(hierarchy)
LinkMember(member,hierarchy)
Parameter | Description |
---|---|
A member specification | |
Optional. A specific hierarchy within the time dimension. |
Notes
This function is applicable only to aggregate storage databases.
If the primary hierarchy is passed to this function, it returns the primary member.
If there is no shared member along the given hierarchy, this function returns an empty member.
If a calculated member is passed to this function, the calculated member itself is returned.
Example
The following examples are based on ASOSamp.Sample.
The following MDX returns the member [HDTV] along the [High End Merchandise] hierarchy. By default, the primary instance of [HDTV] is used.
LinkMember([HDTV], [High End Merchandise])
The following MDX also returns the member [HDTV] along the [High End Merchandise] hierarchy. In this example, the input member is on the input hierarchy.
LinkMember([High End Merchandise].[HDTV], [High End Merchandise])
The following MDX returns the member [HDTV] along the [All Merchandise] hierarchy.
LinkMember([All Merchandise].[HDTV], [All Merchandise])
The following MDX returns an empty member, because there is no instance of [Digital Cameras] along the [High End Merchandise] hierarchy. The empty member has a value of #MISSING.
LinkMember([Digital Cameras], [High End Merchandise])
The following MDX also returns an empty member.
LinkMember([All Merchandise], [High End Merchandise])
The following MDX also returns an empty member.
LinkMember([Products], [High End Merchandise])
The following MDX returns [High End Merchandise].
LinkMember([High End Merchandise], [High End Merchandise])