Search code examples
sql-server-2012ssasmdx

Interpretation of [aDimension].[aHierarchy]


If I just write the following within an MDX script [aDimension].[aHierarchy] can it mean one of three different things depending on the context?

  1. Specifies a hierarchy aHierarchy
  2. Specifies the current member of aHierarchy i.e. is actually evaluated as [aDimension].[aHierarchy].currentmember
  3. Specifies the default member of aHierarchy i.e. is actually evaluated as [aDimension].[aHierarchy].defaultmember

EDIT
An example of case 2 is the following where I believe [Geography].[Geography].parent.NAME is implicitly converted to [Geography].[Geography].currentmember.parent.NAME

WITH MEMBER [Measures].[Parent] AS 
       [Geography].[Geography].parent.NAME
SELECT 
    NON EMPTY 
        {[Geography].[Geography].[Country]}
    ON ROWS,
    {[Measures].[Parent]} 
    ON COLUMNS
FROM [Adventure Works]

Solution

  • I would say [2] is never done that way; you'll have to explicitly specify the currentMember function. [3] is an implicit conversion from hierarchy to member when a member is expected and you give a hierarchy instead.