Wednesday, 21 December 2016

MDX -- Key Points-- Part-5

                                                                       MDX -- Key Points-- Part-5

Same Hierarchy should not appear in different Axis:- 

/*  Same Hierarchy Should not appear in 2 different Axis   */
-- ERROR
-- ERROR-1 (Why?)
SELECT {
         [Measures].[Sales Amount]
          } ON COLUMNS
      ,(
            [Measures].[Tax Amt]
       ) ON ROWS
FROM [MSBI]
 
--ERROR-2  (Why?)
SELECT  [Dim Date].[Calendar Hierachy].[Calendar Year]
           ON COLUMNS
      ,{
        [Dim Date].[Calendar Hierachy].[English Month Name]
       } ON ROWS
FROM [MSBI]
 


-- VALID QUERY
SELECT {
        [Dim Date].[Calendar Year].[Calendar Year]
       } ON COLUMNS
      ,(
         [Dim Date].[English Month Name].[English Month Name]
       ) ON ROWS
FROM [MSBI]


Can not possible to use ON ROWS without ON COLUMNS :- 

/*  Can not possible to use ON ROWS (AXIS(1)) without ON COLUMNS (AXIS(0)) in the query. */
-- ERROR
SELECT
        [Dim Date].[English Month Name].[English Month Name]
        ON ROWS
FROM [MSBI]



-- VALID QUERY
SELECT
        [Dim Date].[English Month Name].[English Month Name]
        ON COLUMNS
FROM [MSBI]


 
Difference between Normal Hierarchy and Attribute Hierarchy:- 
 
/* what is the difference between Normal Hierarchy and Attribute Hierarchy     */
-- Normal Hierarchy     : - Can have many levels
-- Attribute Hierarchy  : - Can have only default 2 Levels
                             -- 1. All Lev
                             -- 2. Member Level



 

No comments:

Post a Comment