Using Conditional Expressions

The base product makes use of common logic that evaluates basic mathematical expressions. This logic can be used to compute values that form part of the calculation or to evaluate conditions to determine whether to apply calculation rules.

The following topics highlight some of the available features for expressions. Other mathematical operators and functions are supported but these are not normally used for standard revenue calculations or simple conditions.

Variables

Variable identifiers must be a character between a-z. Variable identifiers are case sensitive.

Operators

The following types of expression operators are supported.

Mathematical Operators
Operators of *, /, +, - are allowed. Examples of expressions using these operators are:
  • x = a + b + c where the value of x should equal the sum of the values a, b and c

  • x = a * r where r is a rate factor variable

Comparison Operators
Operators of =, != (not equal), <, >, <= and >= are allowed. Examples of expressions using these operators are:
  • x > a where the value of x should be greater than the value of a

  • x != 0 where x must have a non-zero value

Grouping Operators
Parentheses may be used to formulate expressions with sub-computations. An example of an expression using grouping is:
  • x = (a + b) / c where the value of x should be equal to the result of adding values a and b then dividing by the value of c

Functions

The following examples show the use of the most common supported functions:

Ceiling
x = ceiling (a* b) where x should equal the result of multiplying the value of a by the value of b and rounding up to the nearest whole number
Floor
x = floor (a* b) where x should equal the result of multiplying the value of a by the value of b and rounding down to the nearest whole number
Round
x = round (a* b) where x should equal the result of multiplying the value of a by the value of b and rounding the nearest whole number. A result of 1.5 would round to 2 and a result of 1.4 would round to 1.
Any
any [value in a | value !=''] where a is a value from a repeating line and the condition is true if any of the values of a are not blank
All
all [value in a | value !=''] where a is a value from a repeating line and the condition is true if none of the values of a are blank

The system provides a base calculation rule BO and a base calculation rule eligibility criteria BO that make use of conditional expressions to support a wide variety of computations and eligibility rules. These BOs make use of reusable variable definitions that are mapped to standard elements in the calculation processor data area.

Fastpath:

Refer to Common Variables for information about using common variable definitions.