Specialized Administration > Analyzing System and Business Information > Reports and Queries > Query Builder > Criteria (Query Builder) > Adding and Modifying Criteria Conditions
  
Adding and Modifying Criteria Conditions
Click Add Criteria to add a new criteria condition row to the Criteria tab.
A criteria condition typically consists of a left side operand, an operator, and a right side operand. For some operators, such as exists or not null, only a left side operand is needed. Specify an operand by selecting an item from the Select Operand drop-down list.
The following screenshot shows a condition where a Reportable Item of Part.Name is selected for the left side operand, the default like operator is accepted, and a Constant with a String data type, and a value of G* is specified for the right side operand.
The following actions are available on criteria conditions:
Click the edit icon next to an operand to edit the item properties.
Click the replace with icon to select a new item from the drop-down list to replace the current operand.
Select a new operator from the drop-down list.
Click the delete icon to remove the entire condition row from the Criteria tab.
The following table describes the result of selecting each type of operand from the Select Operand drop-down list. For more information on the properties displayed on the Edit windows launched when selecting some operands, see Adding and Editing Report Items.
Operand
Description
Reportable Item
Launches the Select Attributes to Add window. Only columns can be selected; objects are grayed out.
When added, columns display in the condition row as:<table alias>.<attribute name>, where <table alias> is the alias of the table from which the attribute was selected, as specified on the Tables and Joins tab, and <attribute name> is the display name of the attribute as it appeared on the Select Attributes to Add window. For example, Part.Name is displayed for the operand in the condition row when the Name attribute is selected from the Part table.
Constant
Launches the Edit Constant window. Select the Data Type, and specify the desired constant value. When added, the value of the constant displays for the operand in the condition row.
Keyword
Launches the Edit Keyword window. Select the keyword from the drop-down list. When added, the selected keyword displays for the operand in the condition row. For more information about available keywords, see Keywords.
Database Function
Launches the Edit Database Function window. Select the database function from the drop-down list. The data type displayed updates based on the selected function. When added, the name of the function displays for the operand in the condition row, followed by the expand icon .
To add an argument to a Database Function, click the expand icon , and select a report item from the add drop-down list below the Database Function.
In the pseudo-SQL statement, database functions are presented as <function name><...>, where the function arguments are represented by the <...> string.
For more information about available database functions, see Database Functions.
Sub-Select
Adds a sub-select row to the condition. A sub-select is a query within a query. Sub-select queries can be nested within sub-select queries.
Click Edit Sub-Select to launch the Edit Sub-Select window. This window behaves similarly to the parent Query Builder window, containing only the Tables and Joins, Select or Constrain, and Criteria tabs. Note the following differences:
Tables and Joins—The tables specified on the parent query or queries are present, in blue, and are read-only. You must add at least one new table to the sub-select query. Joins can be added between tables from the parent query and tables added in the sub-select query.
Select or Constrain—You must add only one select item to the sub-select query. If no select item is added, an error displays when clicking Apply to save the parent query. Only Reportable Item, Constant, Keyword, and Database Function report items can be added. If adding a Reportable Item, only columns can be selected; objects are grayed out. Only a single column can be selected. You can select columns from both the tables added on the sub-select query, and tables on any parent queries.
On the sub-select query Select or Constrain tab, no Display Name column is shown. This is because only items on the top-level parent query Select or Constrain tab can display on the criteria pane of the Report Builder.
Criteria
If adding a Reportable Item as an operand, columns can be selected from tables on the sub-select query or any parent query; only columns can be added.
If adding a Report Attribute Reference, only parameters or columns from the Select or Constrain tab of top-level parent query can be selected.
If using the Report Attribute Reference > Add Parameter Value to Select or Constrain option, the parameter is added to the Select or Constrain tab of the top-level parent query, not in the sub-select query.
In the pseudo-SQL statement on the parent query, sub-select queries are represented as Sub-Select<...>. The pseudo-SQL statement for the sub-select query itself displays on the Criteria tab when editing the sub-select query.
Report Attribute Reference
A Report Attribute Reference references an item specified on the Select or Constrain tab for the query, and uses it as an operand in the criteria condition. Whatever value the user enters for that item in the criteria pane of the Report Builder is used as the value of the operand. If the user leaves the value empty, then that criteria is ignored when the report is executed.
If adding a Report Attribute Reference as a right side operand, the available items presented are limited to those matching the data type of the left side operand.
When selecting a Report Attribute Reference, the list of available items from Select or Constrain is displayed, in the format <item type>:<item display name>.
Once added, the display name of the item displays for the operand in the condition row.
Select the Add Parameter Value to Select or Constrain option to add a Parameter Value report item to the Select or Constrain tab, and add it as the operand at the same time. On the Edit Parameter window, enter the parameter information. If a name is not entered for the parameter, the system provides a default name, which can later be edited for the parameter on the Select or Constrain tab.