MDX Layer Specification

A layer is a shared depth in the outline hierarchy. Therefore, the concept of layer includes generations and levels. Represent a layer using the following rules:

Syntax

<layer> ::= 
        <layer-name-specification>
      | Levels ( <dim_hier>, <index> )
           | <dim_hier>.Levels ( <index> )      
      | Generations ( <dim_hier>, <index> )
           | <dim_hier>.Generations ( <index> ) 
      | <member>.Generation
      | <member>.Level
SyntaxDescription
<layer-name-specification>

A layer name can be specified in the following ways:

  1. By specifying the generation or level names; for example, States or Regions.

    The generation or level name can be within braces; for example, [Regions]. Using braces is recommended.

  2. By specifying the dimension name along with the generation or level name; for example, Market.Regions and [Market].[States] This naming convention is recommended.

<dimension>.Levels (<index>)Levels function with the dimension specification and a level number as input. For example, [Year].Levels(0).
Levels ( <dimension>, <index> )Alternate syntax for Levels function with the dimension specification and a level number as input. For example, Levels ( [Year], 0 ).
<dimension>.Generations (<index>)Generations function with the dimension specification and a generation number as input. For example, [Year].Generations (3).
Generations ( <dimension>, <index> )Alternate syntax for Generations function with the dimension specification and a generation number as input. For example, Generations ( [Year], 3).
<member>.GenerationGeneration function with a member specification as input. For example, [Year].Generation. Returns the generation of the specified member.
<member>.LevelLevel function with a member specification as input. For example, [Year].Level. Returns the level of the specified member.

Description

Generation numbers begin counting with 1 at the dimension name; higher generation numbers are those that are closest to leaf members in a hierarchy.

Level numbers begin with 0 at the deepest part of the hierarchy; the highest level number is a dimension name.

Hierarchy diagram of members.

Note:

In an asymmetric (or ragged) hierarchy, same level numbers does not mean that the members are at the same depth in the outline. For example, in the following diagram, member aa and member f are both level 0 members, and yet they are not at the same depth:

Hierarchy diagram of members.