As you build a formula, keep in mind that all functions have an order of precedence shown in the following table, where level one is the highest order of precedence. Expressions with a high order of precedence are evaluated before those at lower levels. When an expression has operators of equal precedence, it is evaluated from left to right. You can use parentheses to override other precedence rules when necessary because any expression within parentheses is always evaluated first. Terms have no order of precedence because they cannot be evaluated further. Order of Precedence of Operators in Formulas shows the first six levels of the order of precedence.
+, -
|
|
For example, given a data table with the columns A, B, and C, use the following steps to compose the expression A(B + C). Note that this expression is not the same as A x B + C, which evaluates as (A x B) + C.
1.
|
Select Table Columns from the formula element browser list.
|
2.
|
5.
|
7.
|
However, when you are creating conditional expressions, keep in mind that Match evaluates faster and uses less memory than an equivalent Condition function, If. (Note that Match ignores trailing spaces and If does not.)
For example, using Big Class.jmp, you can predict a child’s height from his age as shown in The Match Conditional Evaluates Faster Than the If Function. There is a base height of 58.125 inches to which a quantity is added depending on the value of the age variable.
The Match conditional evaluates faster than the If function because the age variable is evaluated only once for each row in the data table. The If condition must evaluate the age variable at each If clause for each row until a clause evaluates as true.