Tuesday, 27 December 2016

MDX -- CHILDREN and PARENT -- Part-11

                     MDX -- CHILDREN and PARENT -- Part-11
CHILDREN Function :-                                                                                                                                                                               The CHILDREN Function is used to get the Associated Child Members that belongs to the specified member.

--Example-1:
SELECT [Measures].[Sales Amount] ON COLUMNS,
      [Dim Customer].[Geography Hierarchy].CHILDREN ON ROWS
FROM [MSBI]


--Example-2:
SELECT [Measures].[Sales Amount]
       ON COLUMNS,
       [Dim Customer].[Geography Hierarchy].[English Country Region Name].&[Australia].CHILDREN
          ON ROWS
FROM [MSBI]


--Example-3:
SELECT [Measures].[Sales Amount]
       ON COLUMNS,
      [Order Date].[Date Hierarchy].[Year].&[CY 2008].CHILDREN
          ON ROWS
FROM [MSBI]


--Example-4:
SELECT [Measures].[Sales Amount]
       ON COLUMNS
     ,[Order Date].[Date Hierarchy].[Year].&[CY 2008].&[CY 2008 SEM 2].&[CY 2008 Q4].CHILDREN
      ON ROWS
FROM [MSBI]


PARENT Function :-                                                                                                                                                                               The PARENT Function is used to get the Associate Parent Members of the specified member.
--Example-1:
SELECT [Measures].[Sales Amount] ON COLUMNS,
      [Dim Customer].[Geography Hierarchy].PARENT ON ROWS
FROM [MSBI]



--Example-2:
SELECT [Measures].[Sales Amount]
       ON COLUMNS,
       [Dim Customer].[Geography Hierarchy].[English Country Region Name].&[Australia].PARENT
          ON ROWS
FROM [MSBI]


--Example-2A:
SELECT [Measures].[Sales Amount]
       ON COLUMNS,
       [Dim Customer].[Geography Hierarchy].[English Country Region Name].&[Australia].&[New South Wales].PARENT
          ON ROWS
FROM [MSBI]


--Example-3:
SELECT [Measures].[Sales Amount]
       ON COLUMNS,
      [Order Date].[Date Hierarchy].[Year].&[CY 2007].PARENT
          ON ROWS
FROM [MSBI]


--Example-3A:
SELECT [Measures].[Sales Amount]
       ON COLUMNS,
       [Order Date].[Date Hierarchy].[Year].&[CY 2007].&[CY 2007 SEM 2].PARENT
          ON ROWS
FROM [MSBI]



--Example-4:
SELECT [Measures].[Sales Amount] ON COLUMNS,
      [Order Date].[Date Hierarchy].[Year].&[CY 2007].&[CY 2007 SEM 2].&[CY 2007 Q4].PARENT ON ROWS
FROM [MSBI]







Thanks for Looking into this.....




No comments:

Post a Comment