What are Boolean Expressions?

In addition to numeric expressions, you may use logical operators to create Boolean expressions that compare two numeric expressions yielding a result of True or False. These expression may be used in IF…THEN statements and condition fields to make specific decisions in the model based on the values of two numeric expressions.

Boolean Operators

The following table lists and illustrates the use of Boolean operators to create Boolean expressions.

ItemMeaningExamples
=equal toa_Weight = 2.5
v_Total_Pieces = 50
>greater thana_Weight > 2.5
v_Total_Pieces > 50
<less thana_Weight < 2.5
v_Total_Pieces < 50
<>not equal toa_Weight <> 2.5
v_Total_Pieces <> 50
>=greater than or equal toa_Weight >= 2.5
v_Total_Pieces >= 50
<=less than or equal toa_Weight <= 2.5
v_Total_Pieces <= 50
ANDboth expressionsa_Weight = 25 AND v_Total = 30
v_Total >= 20 AND v_Total <= 30
ORDone or both expressionsa_Weight > 5 OR v_Total <= 20
v_Total = 30 OR a_Weight =15

Examples of Boolean Expressions

You may use simple or compound numeric expressions on either side of the Boolean operator.

IF v_Total_Pieces > 5 * a_Pkg_Qty THEN…

IF (a_Weight + 5) <= (a_Pkg_Qty / 2) THEN…

IF N(25, 4.8) + a_Weight = v_Total_Pieces – 10 THEN…

IF a_Weight >= v_Total_Pieces AND a_Pkg_Qty > 20 THEN…

IF v_Total_Pieces = a_Pkg_Qty OR a_Pkg_Qty > 35 THEN…

Operator Precedence

As in conventional mathematics, ProcessModel evaluates expressions with more than one operator according to certain rules of precedence. Expressions with more than one operator are evaluated from left to right in the following order:

1. Terms inside parenthesis: ( )
2. Multiplication: *; and Division: /
3. Addition: +; and Subtraction:
4. Equalities and Inequalities: =, <>, >, >=, <, <=

What are Expressions?

Was this article helpful?

Related Articles

Go to Top