In MDX, layer refers to generations and levels in an Essbase hierarchy.
In Essbase, generation numbers begin counting with 1 at the dimension name; higher generation numbers are those closest to leaf members in a hierarchy.
Level numbers begin with 0 at the leaf-most part of the hierarchy, and the highest level number is a dimension name.
A number of MDX functions take a layer you specify as an input argument and perform set operations based on the generation or level represented in the layer argument.
You can specify a layer argument in the following ways:
The dimension name along with the generation or level name; for example, Market.Regions and [Market].[States].
The Levels function with a dimension and a level number as input. For example, [Year].Levels(0).
The Level function with a member as input. For example, [Qtr1].Level returns the level of quarters in Sample.Basic, which is level 1 of the Market dimension.
The Generations function with a dimension and a generation number as input. For example, [Year].Generations (3).
The Generation function with a member as input. For example, [Qtr1].Generation returns the generation of quarters in Sample.Basic, which is generation 2 of the Market dimension.
In the Sample.Basic database, Qtr1 and Qtr4 are in the same layer. This means that Qtr1 and Qtr4 are also in the same generation. However, in a different database with a ragged hierarchy, Qtr1 and Qtr4 might not necessarily be in the same level, although they are in the same generation. For example, if the hierarchy of Qtr1 drills down to weeks, and the hierarchy of Qtr4 stops at months, Qtr1 is one level higher than Qtr4, but they are still in the same layer. |