Using Operators and Parentheses

Operators

When a second filter is added to a query, it is placed on the line below the first filter and with an AND operator between the filters. The operator shows the relationship between the filters and tells the system how to evaluate them. For example, suppose you built the following task-related simple query:

Follow Up = "True"

AND Priority = "High"

Here, the AND operator indicates that the task assignment records must match both filters, which means that they must have follow up activities and have a high priority.

Suppose we changed the AND operator to OR:

Follow Up = "True"

OR Priority = "High"

Here, the system would look for task assignments that fit either of the filters—all task assignments that have follow up activities or have a high priority. Any task assignments that fit both filters would also be found (but not duplicated).

Next, suppose we changed the OR operator to AND NOT:

Follow Up = "True"

AND NOT Priority = "High"

Here, the system would look for task assignments that fit the first filter and then subtract out any that matched the second, so all task assignments that have follow up activities that did not have a high priority would be found.

It is important to note that if you use the NOT operator, the query will not select task assignments that do not have an entry for the filter. For example, suppose you want to select all task assignments for a team that are not completed. You would build the following query:

Team = "Tech Team 1"

AND NOT Status = "Completed"

Because task assignments are not assigned a task status initially, the system would not select any task assignment for which you have not assigned a status. The system will ignore task assignments that do not have a status assigned.

Parentheses

Because the system evaluates queries from top to bottom, you may need to use the open and closed parentheses to set off certain filters. Any filters between parentheses will be evaluated as if they were one filter. For example, suppose you want to find all of Stan Tsu's task assignments with a high or medium priority; you might build the following query:

Owner/Responsible Party = "Stan Tsu"

AND Priority = "High"

OR Priority = "Medium"

This query would not achieve the desired result. The system would first find all Stan's task assignments with a high priority because of the AND operator. Then, it would find all task assignments with a medium priority because of the OR operator.

But see how adding parentheses does achieve the desired result in the query below:

Owner/Responsible Party = "Stan Tsu"

AND (Priority = "High"

OR Priority = "Medium")

Here, the priority filters are set off in parentheses, and they are evaluated as one filter. Therefore, the system will find all of Stan's task assignments that have high or medium priority.