You are here: Record management > Building expressions with the Expression Builder > Expression evaluation > Comparison operators

Comparison operators

This table shows the valid combinations of types for comparison operators. To understand the calculation of the expression A > B, find the type of A in the Left Hand Side (rows) of each table. Find the type of B in the Right Hand Side (columns) if the table. Consult the numbered notes for the details of casting or conversion.

Note: The operator ~= evaluates using equalsIgnoreCase().

Right Hand Side

DateTime

Date

Time of Day

Integer

Decimal

Double

True or False

Other (text)

Left Hand Side

DateTime

1

3

X

3

3

3

X

X

Date

3

1

X

3

3

3

X

X

Time of Day

X

X

1

X

3

3

X

X

Integer

3

3

X

2

2

2

X

X

Decimal

3

3

3

2

2

2

X

X

Double

3

3

3

2

2

2

X

X

True or False

X

X

X

X

X

X

4

X

Other (text)

X

X

X

X

X

X

X

5

Legend:

X

A casting, promotion, or conversion is not supported. Pega 7 Platform reports an error.

1

Permitted. Depending upon complexity of expression and intermediate conversions that may have occurred, use either the original ClipboardProperty String form or Java BigDecimal.

2

Permitted. Converts Integer > Double > Decimal until both operands have same type, then performs operation. (Convert directly to target type without performing additional intermediate conversions.)

3

Permitted. Converts to the preferred Java type (and if necessary, promote as described in note 2) and performs the operation.

4

Permitted. Converts to Java boolean and performs the operation.

5

Permitted. Evaluate using String.compareTo(). Note: This is not locale-sensitive.