Set Up the Filter Structure
If you are using the AND and OR logical operators in your filter, you may need to change the filter structure to ensure the filter logic works correctly. This is done by indenting filter criteria and operators to form logical groups. Because filters run according to the logic of mathematics, you must ensure that your criteria are arranged into logical groups, to ensure they are processed the correct sequence. The Filter Designer makes indenting easy.
The order of execution of filter criteria is to process the lowest (indented) level of the tree first and then process AND before OR.
There are two ways to indent criteria:
- by selecting the AND/OR operator
- by selecting a criteria
and clicking Increase Indent or Decrease Indent. The use of these buttons in the Filter Designer follows a set of rules.
Rules for Increasing Indents
- Indenting a Criteria
- The first Criteria at any level cannot be indented - the Increase Indent button is disabled.
- If you select a Criteria to indent, it is indented on its own. The AND/OR logical operator above that Criteria is not indented, but the logical operator below it is also indented.
- Indenting an Operator
- A logical operator cannot be indented if it is the only operator at that level. The Increase Indent button is disabled.
- If you select an Operator, the Criteria before and after the logical operator will also be indented.
Rules for Decreasing Indents
- You cannot decrease the indentation level of the first Criteria - the Decrease Indent button is disabled.
- You can decrease the first level of an indented Criteria. The AND/OR logical operator below the Condition however, stays at the same indented level.
- If you decrease the indent of a Criteria, the logical operator above it is also decreased. If the logical operator is different to all other operators at the new level, then it appears in red.
- If you decrease the indent of a logical operator, the Criteria above and below the logical operator are also decreased.
|