Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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.
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]
Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register today