Cousin
The MDX Cousin function for Essbase returns a child member at the same position as a member from another ancestor.
Syntax
Cousin ( member1, member2 )
Parameters
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. Expanded Product dimension with children 100, 200, 300, 400, and Diet. Expanded Year dimension with children Qtr1 to Qtr4 and descendants Jan to Dec.](img/product_year.gif)
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:
Table 4-48 Output Grid from MDX Example
(axis) | Oct |
---|---|
100 | 2317 |
200 | 2505 |
300 | 2041 |
400 | 1790 |
Diet | 2379 |