Logic for processing multiple Data Set 1 filters

A Data Set 1 filter can be a logical expression made of multiple clauses using the logical operators AND and OR.

Operations on clauses are binary; that is, two values are considered at a time. Clauses are evaluated from left to right. You can use parentheses to alter the order of operations.

By default, AND has a higher priority than OR. Consequently, if no parentheses are present, operands joined by AND are processed first, as shown in the following examples.

Example 1

ClauseA AND ClauseB AND ClauseC

is evaluated as follows:
  1. ClauseA AND ClauseB = Result 1
  2. Result 1 AND ClauseC = Final Result

Example 2

ClauseA OR ClauseB AND ClauseC AND ClauseD OR ClauseE

is evaluated as follows:
  1. ClauseB AND ClauseC = Result 1
  2. Result 1 AND ClauseD = Result 2
  3. ClauseA OR Result 2 = Result 3
  4. Result 3 OR ClauseE = Final Result

Logical AND and logical OR

When the system processes two clauses joined with the logical operator OR, it selects an object for the output set if it meets the criteria of either of the two clauses. If the object matches one of the specified criteria, the system selects it.

When the system processes two clauses joined with the logical operator AND, it selects an object for the output set only if it meets the criteria of both clauses.

When evaluating clauses in a filter, in order to ensure that the correct set of output objects is created for the comparison rule, the system always fully evaluates all clauses. No shortcuts are applied to the logical expression even if it becomes obvious before all clauses are evaluated that the expression will succeed or fail.



Feedback