Request Query Components

To use the query builder to construct a request query, you can combine multiple search terms with logical operators and use comparison operators to define search terms. A search term takes the following form:

<FieldName> <ComparisonOperator> <Value(s)>

where

<FieldName>

represents a field on a request.

<ComparisonOperator>

represents one of the operators listed in Table 4-1. Supported operators for building queries.

<Value(s)>

represents one or more values that the field can accept.

Comparison Operators for Building Request Queries

Table 4-1. Supported operators for building queries lists the comparison operators supported for building request queries in Demand Management. In the Description column, "value on the left" refers to the value of the request field (in the request object), identified by <FieldName> in the search term. "Value on the right" refers to the <Value(s)> specified in the search term (in the query builder).

Table 4-1. Supported operators for building queries

Operator

Symbol

Value

Description

Greater than

>

Number/Date

Value on the left is greater than the value on the right.

Less than

<

Number/Date

Value on the left is less than the value on the right.

Greater than or equal to

>=

Number/Date

Value on the left is greater than or equal to the value on the right.

Less than or equal to

<=

Number/Date

Value on the left is less than or equal to the value on the right.

Equal to

=

Number/Date

Value on the left is equal to the value on the right.

String

Value on the left is the same as the value on the right (case-insensitive match).

Does not equal

!=

Number/Date

Value on the left does not equal the value on the right.

String

Value on the left is not the same as the value on the right (case-insensitive match).

In

IN

Number/Date

Value on the left matches one of the values listed on the right.

String

Value on the left matches one of the values listed on the right.

Not in

NOT IN

Number/Date

Value on the left does not match one of the values listed on the right.

String

Value on the left does not match one of the values listed on the right.

Contains

contains

String

String on the right is a substring of the string on the left.

Not Contains

Not Contains

String

String on the right is not a substring of the string on the left.

Starts with

startswith

String

String on the right is the start of the string on the left (case-insensitive).

Ends with

endswith

String

String on the right is the end of the string on the left (case-insensitive).

Logical Operators for Building Request Queries

The logical operators for building a query are AND, OR, and NOT.

You can use the operators as follows:

  • Use AND/OR to link multiple search terms in a compound query.

  • Prefix the NOT operator to any search term. For example:

    Priority='High' AND Status='InProgress' AND NOT AssignedTo IN {'johndoe','janedoe'}
  • The logical operator is prepended or appended to the new entry, depending on if it is added above or below an existing entry.

Grouping Search Terms in Queries

You can group one or more search terms with parentheses to create complex queries. For example:

(StartedOn > 6/6/09 AND StartedOn < 6/13/09) OR (StartedOn > 6/13/09 AND StartedOn < 6/20/09)