Cousin

Returns a child member at the same position as a member from another ancestor.

Syntax

Cousin ( member1, member2 )
ParameterDescription

member1

A child member. For example, [Year].[Qtr1].

member2

An ancestor for which Cousin() should the return child member at the same position as member1.

Notes

Assuming a symmetric hierarchy, Cousin takes as input one member (member1) from one hierarchy and an ancestor member (member2) of another hierarchy, and returns the child of member2 that is at the same position as member1.

Example

This example uses the following parts of the Sample Basic outline:

Expanded Product dimension with children 100, 200, 300, 400, and Diet. Expanded Year dimension with children Qtr1 to Qtr4 and  descendants Jan to Dec.

The following expression

{ Cousin ( [Qtr2].[Apr], [Qtr4] ) }

returns the member:

[Qtr4].[Oct]

And the following expression

[Product].generations(2).members

returns the set:

{ [100], [200], [300], [400], [Diet] }

Therefore, the following query

SELECT
  { Cousin ( [Qtr2].[Apr], [Qtr4] ) }  
ON COLUMNS,
    [Product].generations(2).members  
ON ROWS
FROM Sample.Basic

returns the grid:

(axis)Oct
1002317
2002505
3002041
4001790
Diet2379