Cousin

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

Syntax

Cousin ( member1, member2 )

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.

Description

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:

product and year dimensions

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:

Oct
100 2317
200 2505
300 2041
400 1790
Diet 2379

©2004 Hyperion Solutions Corporation. All Rights Reserved.
http://www.hyperion.com