Comparison Class

A comparison object represents a comparison statement in an analytic calculation rule.

Use the following to create a comparison class object:

&Comparison = create Comparison(&Constants.Comparison_Type);

Where Comparison_Type is one of the following:

Value

Description

Comparison_Type_Equal

Compare if the value of Operand1 equals Operand2.

Comparison_Type_Greater

Compare if the value of Operand1 is greater than the value of Operand2.

Comparison_Type_Less

Compare if the value of Operand1 is less than the value of Operand2.

Comparison_Type_GreaterEq

Compare if the value of Operand1 is greater or equal to the value of Operand2.

Comparison_Type_LessEq

Compare if the value of Operand1 is less than or equal to the value of Operand2.

Comparison_Type_NotEq

Compare if the value of Operand1 is not equal to the value of Operand2.

Specify Operand1 and Operand2 with the Operand1 and Operand2 comparison class properties.

The following code example creates a rule that compares if the first operand is greater than or equal to the second operand, then adds the rule using the AddArgument method.

&Comparison = create Comparison(&Constants.Comparison_Type_GreaterEq);
&Constant = create Constant(&Constants.Constant_Type_Literal, "1000");
&Comparison.Operand1 = &Constant;
&Constant = create Constant(&Constants.Constant_Type_Literal, "100");
&Comparison.Operand2 = &Constant;
&FunCall.AddArgument(&Comparison);