Dimension Object

An object containing a dimension in the DimensionLine object from a PowerCube.

Discussion

Use this object to change the default settings for dimensions in the DimensionLine object and to determine the properties of the dimension. Each Dimension object includes different levels of categories. You use the object to reference an item in a row, column or layer.

Special categories and alternate drill paths are also recognized by OLE automation. For example, a dimension "Years" may have the two regular categories "1995" and "1996", and three other categories named "Current Month", "QTD", and "Last Month" that represent special categories and alternate drill paths.

Performing a count on the "Years" Dimension

Msgbox Report.DimensionLine.Item("Years").Count

will return "5" because the regular categories and special categories are all visible to OLE automation.

It is possible to filter on a special category by naming it as

Report.DimensionLine.Item("Years").Change("Current Month")

Name

Description

Change Method

Changes the current category for the Dimension object.

ChangeToParent Method

Changes the current category for the Dimension object to the category one level higher.

ChangeToTop Method

Changes the current category for the Dimension object to top-level category.

Children Method

Returns the next child category in the hierarchy for the current dimension.

HasParent Method

Returns whether the current category has a parent.

Levels Method

Returns all levels available in the dimension for a category.

Parent Method

Returns the name of the parent category.

Name

Description

Application Property

Returns the Application object.

BlankWhenDividedByZero Property

Set or returns whether a numeric value divided by zero appears as zero or blanks.

BlankWhenMissing Property

Sets or returns whether missing numeric values appear as zero or blanks.

BlankWhenZero Property

Sets or returns whether zero numeric values are shown as zeros or blanks.

Count Property

Returns the number of categories one level below the current category.

Index Property

Returns the position of the Dimension object in the DimensionLine object.

IsAlternate Property

Returns whether the drill-down path is primary or alternate.

IsCalculatedCategory Property

Returns whether the category is a calculated category.

Level Property

Returns the level of the category in a dimension.

Measure Property

Sets or returns the value and symbol for a specified currency.

Name Property

Sets or returns the name of the Dimension object.

Visible Property

Sets or returns whether the Dimension Line object is visible to the user.

Example

This example changes two of the current categories (one from the Year dimension, the other from the Product dimension) for the DimensionLine object in the current report.

Sub Main()
   Dim objPPRep as Object
   Dim objPPDim1 as Object
   Dim objPPDim2 as Object
   Set objPPRep = GetObject("c:\cognos\change.ppr")
   Set objPPDim1 = objPPRep.DimensionLine.Item("Years")
   Set objPPDim2 = objPPRep.DimensionLine.Item("Products")
   objPPDim1.Change ("1996")
   objPPDim2.Change ("Outdoor Products")
   Set objPPDim2 = Nothing
   Set objPPDim1 = Nothing
   Set objPPRep = Nothing
End Sub

Related Topics