Operator Property
Syntax
ValueRestriction.Operator
Applies To
Discussion
Use this property to specify the operator used to limit the number of categories for the results of an AdvancedQuery.
Operator types available for a value restriction comparison are
- > (greater than)
- < (less than)
- = (equal to)
- >= (greater than or equal to)
- <= (less than or equal to)
- Largest (top n largest values)
- Smallest (bottom n smallest values)
- Between (values within to a specified range)
When using the Between operator, you must specify values for the Operand1 and Operand2 properties. When using the >, <, >=, or <= operator, you must specify a value for the Operand 1 property. When using the Largest or Smallest operator, you must specify a value for the Count property.
For a ValueRestriction, the order of the components is important. The Dimension property must be set before the Measure, Operand1, Operand2, and Count properties and the DimensionFilter method. The Name property can be set anywhere within the filter definition.
Type
String
Access
Read/Write
Example
This example creates an advanced subset that selects countries or regions from the Locations dimension. The value restriction (type 4) limits the results to return only those countries or regions whose Revenue values for Sports Chains are between 25,000 and 100,000.
Sub Main()
Dim strCubePath As String
Dim objPPRep As Object
Dim objValue As Object
Dim objAdvanced As Object
strCubePath = "C:\Cubes and Reports\Great Outdoors.mdc"
Set objPPRep = CreateObject("CognosPowerPlay.Report")
objPPRep.New strCubePath, 1
objPPRep.ExplorerMode = False
objPPRep.Visible = True
Set objValue = objPPRep.ReportQueries.Add(4)
With objValue
.Name = "25000-100000"
.Dimension = "Locations"
.Measure = "Revenue"
.Operator = "between"
.Operand1 = 25000
.Operand2 = 100000
.DimensionFilter 4, "Sports Chain"
End With
Set objAdvanced = objPPRep.ReportQueries.Add(3)
With objAdvanced
.Name = "Locations"
.Dimension = "Locations"
.Level "Country or Region"
.ValueRestriction objValue.Name
.Execute
.AddToReport 0,1,3
End With
Set objPPRep = Nothing
Set objAdvanced = Nothing
Set objValue = Nothing
End Sub