The Query tab defines the content of the report, including the rows and columns included in the report. The information on this tab determines the SQL query that runs to retrieve the data for the report.
Complete the Edit columns section to define the columns to include, and how to format and display their values. Complete the Edit filters section to describe which class instances or records to include.
This section defines the columns in the report. Columns display in the report in the same order as in this list. To change the column display order, drag and drop the column in the list.
For each column in the report, the following fields are available:
Field | Description |
---|---|
Column source |
Specify a Single Value property, which may be a top-level or embedded scalar property, identified by a property reference. Instead of specifying an existing Single Value property, you can use the Calculation Builder to select a function template and provide database columns for it to operate on. The column in the report displays the result of the SQL function. To open the Calculation Builder, click the Calculation Builder icon. For more information, see The Calculation Builder. If your application has declare index rules, you can choose one of the properties in the declare index as a column. Type part of the declare index name and click the down-arrow. The rule appears as one of the Best Bets. When using a Report Definition to query the search index, you may need to modify the list of filterable and returnable properties for that class. See How class instances are stored in the search index and Specifying custom search properties. If you enter the name of property that has not been optimized, your system might experience a performance slowdown when running the report. You might want to use unoptimized properties while working out the report's structure and contents, but optimize all properties before moving the code to a production system. Reports that use unoptimized properties in filters or selects result in a warning message in the Report Editor or the report definition. Reports that have a join filter with unexposed properties result in a run-time error. In many situations, you can use a linked property to populate a column (or the right side of a filter condition; see below). If you are building a report on unresolved work items, you can include a column with the access group of the creator of the work item by using the linked property .pxCreateOperator.pyAccessGroup. You cannot reference data page properties that take parameters (such as D_page1[companyName:D_page2[param2:Param.P1],param2:pxRequestor.pyUserIdentifier].pyLabel). Although, you can directly reference properties in a data page (such as D_page1.companyName). |
Column name |
Enter a column heading to be used for this column on the report. By default, the label defined for the selected property appears as the column heading. This field is required for most columns, but is not required when the Summary function field has a value. |
Summarize |
Specify one of the built-in functions COUNT(), COUNT DISTINCT(), SUM(), AVG(), MAX(), or MIN() to aggregate the data in the column. Depending on your choice of property for the column, some summary functions might not appear as options. If a summarize function is selected, two filter conditions sections will be displayed: Filter conditions to apply BEFORE aggregation and Filter conditions to apply BEFORE aggregation. If summarize function is not selected, only one filter conditions section will be displayed. |
Sort type |
Optional. For each sorted column, you specify one of the following options:
|
Sort order | Optional. If you are sorting the values for more than one column on the report, enter a unique value for each sorted column as an integer between 1 and the number of sorted columns. |
Click the Options icon to select formatting options for that column in the Edit column options window:
Option | Description |
---|---|
Column width |
Specify the column width as a percentage of the window's width or in pixels. Enter an integer in the first field, and select either px or % in the second field. |
Column format | Specify a format to use for the values for the column. Leave blank to use the default format associated with the property. Many formats accept parameters. |
Display values across columns | Available only for summary reports. Check to create a pivot-table style report, in which values for one or more columns display horizontally. |
Hide column | Available only for list reports. Check to hide the column in the displayed report. |
This section defines filter conditions, which determine which rows of data are included in the report. If you leave this section empty, the report selects all instances of the Applies to class (or instances or records of whatever sources are indicated on the Data Access tab), up to the limit in the Maximum number of rows to retrieve field on the Data Access tab. Pega Platform converts information in this section to an SQL WHERE clause when retrieving data from the database.
To prevent reports that run a long time and impact performance, define appropriate filter conditions. Define filter conditions that are as restrictive as possible, while still including the data needed for the report user.
If any column in the report includes a Summarize function, an additional section title Filter conditions to apply BEFORE aggregation is displayed, and a separate section is displayed for filters after aggregation. If no columns have a Summarize function, these additional items are not displayed.
If you define filter conditions in this section, you must enter a logical expression in the Filter conditions text box above the list of filter conditions. Using the labels entered in the Condition column, enter a logical expression that specifies how to combine the conditions. The expression can include parentheses and the operators AND and OR. For example, if the table contains four rows labeled A, B, C, and D, you can enter an expression like (A OR B OR C) AND D
. The expression must include all labels within the Condition column; that is, it must include every filter condition.
Each row of the array in this section identifies a filter condition. The order of rows is not significant. Pega Platform converts information in this array to an SQL WHERE clause when retrieving data from the database.
Field | Description |
---|---|
Condition |
Specify a letter (or letters) that uniquely identifies this row. This condition is used to reference this row in the Logic field, and can be as simple as |
Caption |
Optional: Provide a caption to identify the filter condition in the Filters list that displays above the data when the report runs. Depending on which option you selected for Filter caption settings at the bottom of the section, the caption you set for each condition applies to the column within the condition (if the caption is "customer", then "customer = 'brown'"), or to the entire condition ("customer"). |
Column source |
Specify a property reference for the conditions. The property referenced must be exposed as a database column in the Applies To class for the report value, or else be a fully qualified value to a clipboard page that is always present on the clipboard, such as the requestor page or process page. You can specify only You can specify Single Value properties that are produced by an SQL function. To use the result of an SQL function query, click the Calculation Builder icon to the right of the field. The Calculation Builder opens, and you can select an SQL function and specify parameters. For more information, see The Calculation Builder. If the type of this property is If you enter .pxObjClass and the Applies To class of this report definition is a framework class, and if the developer has checked the Report on descendant class instances check box in the Report Definition form, at run time the report can use the corresponding implementation class, not the framework class, for comparisons and report content. This feature eliminates the need to copy each framework class-based report definition into the implementation class. When you specify an embedded property in a page list or page group, you must enter an index or name for each page list or age group; for example, pyproductList(1).pyProdName. However, this index is ignored at run time, which results in an ANY-type filter being generated that is satisfied if any value in the page list or page group satisfies the condition. |
Relationship | Select a logical operator for the comparison condition, such as Is equal or Starts with . If you select |
Value |
Specify one of the following options as a comparison value:
If the Relationship field is set to IS NULL or IS NOT NULL, leave this field blank. Commas correspond to an OR test: If the Value field contains two or more entries separated by commas, the comparison is true at run time if the value of the Column field equals (or is greater than, or is contained in, and so on) any one of the entries. When the Value field contains a When evaluating either of the two Condition values Using the Select values window The Select values window provides one or more of the following tabs:
|
Click the Options icon at the right of any condition row to edit the filter options:
Option | Description |
---|---|
Field value key | Provide the field value key used for localizing the Select Values pop-up window that opens from the Report Viewer when a user changes filter conditions. |
Report Viewer options |
Select a value to determine how a user of this report can modify the condition in this row when the report is run and displayed in the Report Viewer.
|
Use null if empty |
This option is important only when there is no value at run time specified in the Value field. By default, when the Value field is empty at run time, the criteria defined by this row is ignored, and processing is the same as if this row is not present. For example, assume the criteria is that the customer's last name starts with a given letter, and the value set in the Value field is param.Letter. If this report runs at a time when Param.Letter has the value "C", this criteria limits the report to contain only instances in which the Lastname property value starts with the letter C. However, if the same rule runs again when the Param.Letter parameter has no value, this criteria is dropped, so instances with any Lastname value (or none) are selected. In situations where this default behavior is not desirable, select the Use null check box to force the Condition value to become |
Ignore case |
Select this option to have run time comparisons of the Field value and the Value value be case-insensitive. For example, "Smith" matches "SMITH" and also matches "sMiTH". If selected, at run time " When you do not select this option, tests of the Field value and the Value value occur without case conversion. In this case, " In most cases, do not select this option. Select this box only when necessary to obtain the rows of the report:
|
This control lets you specify whether the caption you set for each condition (such as "customer") applies to the left side of the condition ("customer = 'brown'"), or to the entire condition ("customer").
The section Filter conditions to apply AFTER aggregation is displayed only if the report includes a column with a Summarize function, which is also known as an aggregate column. If your report includes an aggregate column, you can add filters that the system applies after calculating aggregate values. By using these filters you can, for instance, display the rows that fall below or between some minimum (severity < 50) or maximum (rating > 75) aggregate value.
If you define filter conditions in this section, you must enter a logical expression in the Filter conditions text box.
For each filter condition, the following fields are available. You do not provide captions for these filter conditions, because they are not displayed in the Report Viewer. The column source does not display either, because it is the aggregate column of the report.
Field | Description |
---|---|
Condition |
Specify a letter (or letters) that uniquely identifies this row, to reference this row in the Logic field. This condition can be as simple as |
Function |
Select the aggregation function for the aggregate column on which you want this filter to operate. If the function is COUNT and the column label is "customer", the function option appears here as "COUNT(customer)" to distinguish it from functions related to other aggregate columns in the report. |
Relationship | Select a logical operator for the comparison condition, such as Is equal or Greater than . If you select |
Value |
Specify one of the following options as a comparison value:
Commas correspond to an OR test: If the Value field contains two or more entries separated by commas, the comparison is true at run time if the value of the Column field equals (or is greater than, or is contained in, and so on) any one of the entries. When the Value field contains a When evaluating either of the two Condition values |
Additional options might be available:
Control | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
Remove duplicate rows | For list reports, when this option is selected, the report discards rows that have duplicate values for the columns selected for the report. This action does not modify the stored data. | ||||||||
Filter by rule resolution |
For report definitions that are defined on the Rule- class, or a class derived from Rule-, select this check box to restrict the rule instances included to those that satisfy the rule resolution procedures. Circumstancing is ignored. |
||||||||
Filter by application context |
For report definitions that are defined on the Rule-class, or a class derived from Rule-, select this check box to restrict report coverage to those in a certain application context. When you select this check box, additional fields are available so that you can set application context filters:
When using the application context filtering option, you can add and sort report results by the values in a hidden column like pyRulesetVersion. |
For list reports, you can limit the number and type of rows of data that the report returns to those with the highest or lowest values of some property:
For example, for a report that shows the three most recently entered cases for each customer, select the Group results check box to sort the results by customer. In the Top/Bottom Rank section, specify:
Display Top ranked 3 Rows For each group based on .pxCreateDateTime