A Data Set 2 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.
ClauseA AND ClauseB AND ClauseC
ClauseA OR ClauseB AND ClauseC AND ClauseD OR ClauseE
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 evaluating two clauses joined with the logical operator AND, the system first checks the type of objects specified (for example, processor, computer system, operating system) in the two clauses. If both clauses specify objects of the same type, the system selects only objects that are specified in both clauses. This means that only the objects that are specified in both clauses joined by the AND operator go to the output set.
When one of the clauses joined by the logical operator AND yields an empty set, the system does not select any objects for the output set.
When the clauses do not yield an empty set and specify objects of different types (for example, computer system and operating system), the system selects an object if it meets the criteria of either of the two clauses, the same way it would select objects if using the logical operator OR.
This behavior of the logical AND for Data Set 2 might seem counterintuitive at first, but consider the case when the filter is designed to select all Dell computer systems with Microsoft Windows XP operating systems. A filter for this situation must have at least two clauses—one that selects computer systems with the manufacturer Dell and another that selects Windows XP operating systems. These two clauses are joined with a logical AND, but they contain different types of objects. The comparison rule will yield a successful result if both the clauses produce a non-empty set and the system finds objects that match either the computer system or operating system.
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.