Levels

Analysis Services

Analysis Services

Levels

Returns the level specified by a numeric or string expression.

Syntax
Numeric

«Dimension».Levels(«Numeric Expression»)

Returns the level whose zero-based position is specified by «Numeric Expression».

String

Levels(«String Expression»

Returns the level whose name is specified by «String Expression».

Remarks

Use the string version of the Levels function for user-defined functions.

Examples

The following examples assume that the Time dimension has (All), Year, Quarter, Month, Week and Day levels.

Numeric

The following example returns the Quarter level:

Time.Levels(2)
String

The following example returns the Year level:

Levels("Year")