Cousin (MDX)Cousin (MDX)

返回与指定的子成员在父成员下方具有相同的相对位置的子成员。Returns the child member with the same relative position under a parent member as the specified child member.

语法Syntax

  
Cousin( Member_Expression , Ancestor_Member_Expression )  

参数Arguments

Member_ExpressionMember_Expression
返回成员的有效多维表达式 (MDX)。A valid Multidimensional Expressions (MDX) expression that returns a member.

Ancestor_Member_ExpressionAncestor_Member_Expression
返回祖先成员的有效多维表达式 (MDX) 成员表达式。A valid Multidimensional Expressions (MDX) member expression that returns an ancestor member.

备注Remarks

此函数按各级别内的成员的顺序和位置进行操作。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

下面的示例根据 2002 会计年度第四季度在 2003 会计年度中年级别上的祖先检索它的同级。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. 检索到的同级是 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]  

下面的示例根据 2002 会计年度 7 月在 2004 会计年度第二季度中季度级别上的祖先检索它的同级。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. 检索到的同级是 2003 年 10 月。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]  

另请参阅See Also

MDX 函数引用 (MDX)MDX Function Reference (MDX)