Monday, 26 December 2016

MDX -- FUNCTIONS -- Members-- Part-6

                                 MDX -- FUNCTIONS -- Members-- Part-6
MEMBERS Function:-
                                                    In this post we are going to discuss about many uses of MEMBER Function.

/*  Members with Dimensions   */
-- 1. Members
-- Example -1
SELECT {
         [Measures].[Sales Amount]
        ,[Measures].[Order Quantity]
          } ON COLUMNS
          ,[Dim Date].[Calendar Year].MEMBERS ON ROWS

FROM [MSBI]



-- Example -2
SELECT {
         [Measures].[Sales Amount]
        ,[Measures].[Order Quantity]
          } ON COLUMNS
          ,[Dim Date].[Calendar Year].[Calendar Year].MEMBERS ON ROWS
FROM [MSBI]


  

 -- 2. ALL Member
SELECT {
         [Measures].[Sales Amount]
        ,[Measures].[Order Quantity]
          } ON COLUMNS
          ,[Dim Date].[Calendar Year].[ALL] ON ROWS
FROM [MSBI]



  -- ALTERNATIVE METHODE
SELECT {
         [Measures].[Sales Amount]
        ,[Measures].[Order Quantity]
          } ON COLUMNS
          ,[Dim Date].[Calendar Year] ON ROWS
FROM [MSBI]




-- 3. Except All
SELECT {
         [Measures].[Sales Amount]
        ,[Measures].[Order Quantity]
          } ON COLUMNS
          ,[Dim Date].[Calendar Year].[Calendar Year] ON ROWS
FROM [MSBI]


-- 4. Partucular Member(2005 data) data
SELECT {
         [Measures].[Sales Amount]
        ,[Measures].[Order Quantity]
          } ON COLUMNS
          ,[Dim Date].[Calendar Year].&[2005] ON ROWS
FROM [MSBI]

 -- 5. allmembers Function
SELECT {
         [Measures].[Sales Amount]
        ,[Measures].[Order Quantity]
          } ON COLUMNS
          ,[Dim Date].[Calendar Year].allmembers ON ROWS
FROM [MSBI]


/*  Members with Measures   */
--Example-1 (USED to get all the measures from the Cube)
SELECT {
         [Measures].members
          } ON COLUMNS
          ,[Dim Date].[Calendar Year].[Calendar Year] ON ROWS
FROM [MSBI]



-- allmembers [will also include Calculated Measures]
--Example-2
SELECT {
         [Measures].allmembers
          } ON COLUMNS
          ,[Dim Date].[Calendar Year].[Calendar Year] ON ROWS
FROM [MSBI]





Thanks for Looking into this.....




No comments:

Post a Comment