Adding Sub-Filters/Indented Fields
The use of indented fields is similar to the use of parentheses when writing an equation. Logic in indented fields is grouped together and calculated first, then the results are factored into the rest of the query. This is most commonly used when utilizing the "Or" modifier on query filters.
Example: A query is needed that searches active committee members by first or last name. A committee member is considered active if their End Date is after today OR they have no listed End Date.
Creating an "Or" Statement Within Query Filters
-
Create a new query or modify an existing query.
Note: For more on building queries, see Creating a New Query.
-
In Step 2 of the query builder, note the blue Add Sub-Filter button that appears in the bottom of the section. Clicking this button creates an indented sub-filter field. In the image below, the sub-filter button is circled, with an arrow indicating two indented sub-filter fields.
-
As an indented field, enter the first filter option of the Or statement. (E.g. An "End Date" filter with an operator of "Is Greater Than or Equal To" and a value of "[Today]"). Leave the modifier for his filter as "And".
-
Click the Add Filter Row button that appears directly under the sub-filter. Another indented field will appear.
-
In the new field, change the modifier to "Or".
-
Enter the second filter option of the Or statement. (E.g. An "End Date" filter with an operator of "Is Null")
-
Repeat steps 4-6 to add additional options that fall under the same Or statement.
-
Repeat steps 2-6 to add a different Or statement.
-
In the example above, the query would run indented fields first, thereby eliminating from results any committee members whose membership term is not current (in the past/expired or in the future/not started). Remaining results are filtered by the remaining, non-indented fields.
Note: Any query that uses a combination of "And" and "Or" modifiers mustindent the filters to which the"Or" statement applies in order to process correctly.