Level Property

Returns the level of the category in a dimension.

Syntax

object.Level

Applies To

Column Object

Dimension Object

Layer Object

Row Object

Discussion

Use this property to return the level (not the nesting level) of a category. Top level categories in a dimension do not have levels. Alternate categories, calculated categories and some measures, depending on the cube type, do not have levels. If you use this property on a category that has no level, the name of the level returned will be an empty string.

Type

Object

Access

Read

Example

This example uses the Level property to determine the name of the Column object.

Sub Main
   Dim objPPRep As Object
   Dim objColumn As Object
   Dim objLevel As Object
   Dim strLevel As String
   Dim strDrill As String
   Dim strCategory As String
   Set objPPRep = GetObject(,"CognosPowerPlay.Report")
   Set objColumn = objPPRep.Columns.Item(1)
   Set objLevel = objColumn.Level
   strLevel = objLevel.Name
   If objColumn.IsAlternate = True Then
      strDrill = "alternate"
   Else
      strDrill = "primary"
   End If   
   If objColumn.IsCalculatedCategory = True Then
      strCategory = ""
   Else
      strCategory = "not"
   End If   
   MsgBox "The " & objColumn.Name & " category
is a " & _
      strDrill & " drill-down and is " & strCategory
& _
      " a calculated category." & chr$(10) &
chr$(10) & _
      "It is a member of the " & strLevel & "
level."
   Set objColumn = Nothing
   Set objPPRep = Nothing
End Sub

Related Topics