MDX Layer Specification

In MDX, a layer is a shared depth in the outline hierarchy. Therefore, the concept of layer includes Essbase generations and levels. Represent a layer in MDX using the following syntax 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

Table 4-11 Ways to Specify a Layer in MDX

Syntax Description
<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 brackets; for example, [Regions]. Using brackets 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>.Generation Generation function with a member specification as input. For example, [Year].Generation. Returns the generation of the specified member.
<member>.Level Level 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.


Description of ac_gnlv1.gif follows
Description of the illustration ac_gnlv1.gif

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:


Description of ac_gnlv2.gif follows
Description of the illustration ac_gnlv2.gif