Multiplication Method (Collections)

Multiplies a constant value or a category by one or more categories.

Syntax

collection.Multiplication[(Operand)]

Applies To

Columns

Layers

Rows

Discussion

This method can also multiply multiple categories together.

Depending on whether the method was applied to an object or a collection, the results are returned respectively as an object or a collection.

In Explorer mode, the new calculation is inserted directly after the last operand. In Reporter mode, the new calculation is inserted directly after the active row or column.

References to the position of an object in the collection are not valid after you use this method.

In Explorer mode, 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.

Parameters

Description

Operand

Optional. Specifies either a constant value or a category object. If you do not specify this parameter, this method creates a category to display the results of the multiplication of all the categories in the collection. If you specify this parameter, this method determines a result from each category and a new category is created for each result.

Type: Variant

Return Type

Object

Example

This example multiples the first five rows by a constant value and multiplies column one by column four.

Sub Main()
   Dim objPPRep As Object
   Dim objRslt As Object
   Set objPPRep = GetObject( , "CognosPowerPlay.Report")
   objPPRep.Rows.SubSet(1,5).Multiplication 6
   Set objRslt = objPPRep.Rows.Item(1).Multiplication
_
      (objPPRep.Rows.Item(4))
   MsgBox "The result of multiplying column 1 by column
4 is " _
      &objPPRep.CellValue(objRslt,1)
   Set objRslt = Nothing
   Set objPPRep = Nothing
End Sub

Related Topics