Exponentiation Method

Raises one or more categories to the power of either another category or a constant value.

Syntax

object.Exponentiation(Operand [, Reverse])

Applies To

Column Object

Columns

Layer Object

Layers

Row Object

Rows

Discussion

This method always requires an Operand since the calculation is done on a pair of values. A category is created for the result of the exponentiation. You can reverse the exponentiation.

Depending on whether the method was applied to an object or a collection, the results are returned respectively as an object or a collection. The new calculation is inserted directly after the active row or column.

This method can also raise a constant value to the power of one or more categories.

References to the position of an object in the collection are not valid after you use this method. If you change a report by removing a level, drilling, filtering or nesting, then all calculations that can not be created in the changed report disappear.

Note: In Explorer mode, you cannot perform this calculation on a group of categories. If more than one category is selected, the Exponentiate calculation is disabled.

Parameters

Description

Operand

Required. Specifies either a constant value or a category object.

Type: Variant

Reverse

Optional. Specifies whether the Operand is the value to be exponentiated or the exponent. If True, the Operand is the value to be exponentiated. If False, it is the exponent.

Default: False.

Type: Boolean

Return Type

Object

Example

This example raises the values in one column to the power of a constant value and returns the results in a new column.

Sub Main()
   Dim objPPRep as Object
   Dim objPPCol as Object
   Set objPPRep = CreateObject ("CognosPowerPlay.Report")
   objPPRep.Open "C:\Cubes and Reports\Sample1.ppx"
   objPPRep.ExplorerMode = False
   Set objPPCol = objPPRep.Columns.Item("Tents")
   objPPCol.Exponentiation(2)
   objPPRep.Save
   Set objPPCol = Nothing
   Set objPPRep = Nothing
End Sub

Related Topics