To build complex filters that use OR, negation, and other options that simple filters do not provide, use the query language. To write a complex filter, type a question mark ? (or an asterisk *) in the filter box. The system then offers attributes to filter by, a logical operation, or a filter value. A complex filter can be combined with a simple one set by the drop-down lists.
Complex filters that you use often are worth saving, so you can reuse them in other modules, drop-down lists, and so on.
When you save a filter, give it a short name that is easy to understand, and you can make it public (shared with the team). Saved filters are edited in the project settings, under "Appearance" — "Saved filters".
In drop-down lists, saved filters are shown at the top, with a question mark:
A complex filter set up once can then be used to select data quickly for typical conditions.
A query is made of the logical operators AND, OR, and NOT, equality and inequality operators, and the set operator IN. For a "contains" search, use the tilde character. You can raise the priority of a logical operation with parentheses. Leave a space between operands and values.
The left operand is the path to an attribute. In the simple case this is the system name of the attribute, for example Caption. The system suggests which attributes you can choose. The full set of attributes is also available in the "Developer reference" module.
Id is the attribute that holds the object identifier. For example, the expression ?Id = 123 filters data by a specific object ID.
Some attributes are references to other objects. To reach them, use a dot. For example, ?Project.CodeName = "test" selects data for a specific project.
If the filter should use an object's name, you can omit the Caption attribute. For example, ?Tags = "one" AND NOT Tags = "two" selects data that has a tag named "one" and does not have a tag named "two".
The right operand is a scalar value (a number, or text in quotes).
With the IN operator, list the values separated by commas, for example IN "one, two, three"
The right operand can also be an attribute of the object. For example, ?Planned < Fact selects tasks whose actual effort exceeds the planned effort.
Several built-in keywords can be used as the right operand:
When you specify a date, you can use relative expressions, for example now for today and "-1 days" for yesterday.
Search queries can sort the results. At the end, add ORDER BY and the system name of an attribute. Sort direction is ASC for ascending and DESC for descending. To sort by several fields, use a comma, for example ORDER BY Caption ASC, Email DESC
Query examples: