Database Reference
In-Depth Information
Logical Operators
The logical operators evaluate values and come up with a Boolean (Yes/No) result. Unlike
the other operators, most of them are recognizable words:
▪ The
and
operator tells you if both values are Yes. The calculation below uses the
and
op-
erator. It evaluates to Yes if the length is greater than 3
and
the height is greater than 5.
ShapeLength > 3 and Height > 5
▪ The
or
operator tells you if
either
value is Yes. The
or
calculation below evaluates to Yes
if the length is greater than 3
or
the height is greater than 5.
ShapeLength > 3 or Height > 5
▪ The
xor
operator's function is as offbeat as its name. It stands for
exclusive or
. The
xor
operator tells you when
only one
of your two choices is Yes. Put another way, if you find
yourself thinking, “I want one of two things to be true, but
not both
of them,” then
xor
saves the day. For instance, you may want to track whether you've billed a customer
or
you've marked her character rating below 3. That formula looks like this:
Invoice Sent = Yes xor Character Rating < 3
NOTE
If you can't think of a use for
xor
, don't worry. Most of the time when you need an “or” calcu-
lation, you can handle it with plain old
or
and not
exclusive or
.
▪ The last logical operator,
not
, stands alone: It works only on one value, not two like
every other operator. It simply reverses the Boolean value that comes after it. So the cal-
culation below would evaluate to Yes if the length is
not
greater than 3.
Not Length > 3
NOTE
In practice comparison and logical operators are commonly combined with the
logical functions
you'll find on
Trigonometric Functions
.
Parentheses
FileMaker uses standard mathematical rules to decide in what order to evaluate things. The
order of evaluation is exponentiation, then multiplication/division and then lastly addition/