Export (0) Print
Expand All
Avg
IIf
Lag
Max
Min
Mtd
Qtd
Sum
Var
Wtd
Ytd
Expand Minimize
0 out of 7 rated this helpful - Rate this topic

Cousin (MDX)

Updated: 17 July 2006

Returns the child member with the same relative position under a parent member as the specified child member.


Cousin( Member_Expression , Ancestor_Member_Expression )
Member_Expression

A valid Multidimensional Expressions (MDX) expression that returns a member.

Ancestor_Member_Expression

A valid Multidimensional Expressions (MDX) member expression that returns an ancestor member.

This function operates on the order and position of members within levels. If two hierarchies exist, in which the first one has four levels and the second one has five levels, the cousin of the third level of the first hierarchy is the third level of the second hierarchy.

Examples

The following example retrieves the cousin of the fourth quarter of fiscal year 2002, based on its ancestor at the year level in fiscal year 2003. The retrieved cousin is the fourth quarter of fiscal year 2003.

SELECT Cousin 
   ( [Date].[Fiscal].[Fiscal Quarter].[Q4 FY 2002],
     [Date].[Fiscal].[FY 2003]
   ) ON 0
FROM [Adventure Works]

The following example retrieves the cousin of the month of July of fiscal year 2002 based on its ancestor at the quarter level in the second quarter of fiscal year 2004. The retrieved cousin is the month of October of 2003.

SELECT Cousin 
   ([Date].[Fiscal].[Month].[July 2002] ,
    [Date].[Fiscal].[Fiscal Quarter].[Q2 FY 2004]
   ) ON 0
FROM [Adventure Works]

Release History

17 July 2006

Changed content:
  • Updated syntax and arguments to improve clarity.
  • Added updated examples.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.