Data Filters |
|
To define selection criteria for a report, you can set up two different kinds of filters, Static and Dynamic. Static Filters are set filters that are automatically applied to the report whenever it is run. Dynamic Filters are filters that are defined by the end user at run time.
(Support for defining Dynamic Filters was added in PxPlus 2022.)
The Define Static Filters window is used to set up static selection criteria to filter the data for the report. Data is filtered based on filter sets. A filter set consists of one or more conditions, all of which must be true for the filter set to be true. For each filter set, select any conditions you wish to apply for each table element to be used in the filter.
In addition, a System Value called Static Filter can be placed on the report layout to display a description of the Static filters.
To invoke the Define Static Filters window, select Filters > Static Filters from the Report Designer Data menu.
This window consists of the following:
Element |
List of table elements. | |||||||||||||||||||||||||
Condition |
The drop down presents a list of the conditions that can be applied to data filters: None | |||||||||||||||||||||||||
Case Sensitive |
Check box to indicate if the filter condition is case sensitive. | |||||||||||||||||||||||||
Value 1, Value 2, … |
Enter any value(s) to be used in comparisons. Comparison values can be selected from a set of options consisting of formulas, parameters or other table elements, or fixed text/numeric values can also be entered. Use double quotes ("") to indicate a null value. | |||||||||||||||||||||||||
Accept (Reject) data if all conditions in this set are met |
A filter set also includes an option to accept or reject a data record based on the outcome of its conditions. If a filter set is evaluated as not true, then the next set is evaluated (and the next) until a set is evaluated as true, at which point the associated option determines whether the record is accepted or rejected. Up to eight filter sets may be defined. If no filter sets are found to be true, then the inverse of the last filter set option determines if the record is accepted or rejected. Example 1:
The above filter sets would be used to process records from 1000 to 1999 and 4000 to 4999. Example 2:
The above filter sets will process all "A" records with Amount > 1000, all "B" records with Amount > 2000, reject all "C" records or records with Amount < 5000. | |||||||||||||||||||||||||
Filter Set |
A group of buttons located in the bottom left corner of the panel:
| |||||||||||||||||||||||||
Ok |
Saves the Static filters and closes the Define Static Filters window. | |||||||||||||||||||||||||
Cancel |
Cancels any changes and closes the Define Static Filters window. |
When a report is generated, if a report has one filter set with an Accept option, the filters are analyzed to determine if minimum/maximum values can be applied to the sort sequence of reports using predefined sorts. These can be used to optimize the data retrieval process. In the case of custom sort sequences, an attempt is made to map the sort to an existing internal key so the same optimization may be used.
The Define Dynamic Filters window is used to set up dynamic selection criteria to filter the report. To set up dynamic filters, first select the Use Dynamic Filters check box and then select which report items are to be made available to the end user to set up filter conditions at run time.
In addition, a System Value called Dynamic Filter can be placed on the report layout to display a description of the Dynamic filters.
To invoke the Define Dynamic Filters window, select Filters > Dynamic Filters from the Report Designer Data menu.
This window consists of the following:
Use Dynamic Filters |
Select this check box to invoke the end-user Define Filters window at run time. If parameters have been defined for the report, the run-time Define Filters window is accessed by clicking the Advanced Filters hyperlink button on the generic interactive parameter interface. Note: |
Select items to include in the Dynamic Filters |
Displays a tree view that lists all the data fields (file fields and calculated fields). Select the check box beside the fields that are to be made available to the end user at run time to set up filter conditions. Note: |
Ok |
Saves the selections and closes the Define Dynamic Filters window. |
Cancel |
Cancels any changes and closes the Define Dynamic Filters window. |
If the Use Dynamic Filters check box has been selected for a report, at run time, the end-user Define Filters window will be presented (unless the report is running in the background):
If Parameters have been defined for the report, the Advanced Filters hyperlink button on the generic interactive parameter interface is used to invoke the end-user Define Filters window:
The Define Filters window consists of the following:
Include/Exclude/And |
Filters can be set to include or exclude records based on conditions. The drop down presents a list of available functions: Include if…, Exclude if…, and And. A condition can be simple, or it can be compound using multiple Include if…, Exclude if…, or And functions in combination. Examples: An Include if... or Exclude if... function followed immediately by one or more And functions means that all conditions must be true for the Include if… or Exclude if… function to be implemented: Include if... CST_BALANCE Is greater than 0 The record would only be included if (CST_BALANCE>0) AND (CST_DUE_DATE$<DAY). Using multiple Include if... functions in succession will result in records being included if any of the Include if… functions are found to be true: Include if... CST_BALANCE Is greater than 0 The record would be included if either is true: ((CST_BALANCE>0) AND (CST_DUE_DATE$<DAY)) OR ((CST_BALANCE>CREDITLIMIT)) The same is true excluding records with successive Exclude if... functions. If there is a combination of Include if... and Exclude if... functions, then the record would only be included if the Include if... function was true and the Exclude if... function was false. | ||||||||||||
Fields to test |
The drop down presents a list of available fields to test, which may be data file fields or calculated fields. The fields in this list were selected in the Define Dynamic Filters window when designing the report. | ||||||||||||
Condition |
The drop down presents a list of conditions that can be applied to Dynamic filters: Is Equal To (The "Is Any of: ?|?|?|…" condition was added in PxPlus 2023.) | ||||||||||||
Case Sensitive |
Check box to indicate if the value is case sensitive. | ||||||||||||
Values are literal values (without quotation marks), and null values are left blank. By default, text values are not case sensitive unless the Case Sensitive check box is selected. All conditions support a single value to compare, except for the Is Any of: ?|?|?|… condition which can have several assigned values separated by the | (pipe) character. Some fields may have associated queries. In this case, the Value to compare may be selected by clicking the lookup button to invoke a Select Items window to select single or multiple values:
This window consists of the following:
(The Select Items window for selecting records was added in PxPlus 2023.) | |||||||||||||
Delete |
Button located beside the grid that is used to remove the selected filter condition. | ||||||||||||
Apply Filters |
(Available when a Filter condition is defined) Generates the report with the filter condition(s) applied. | ||||||||||||
Skip Filters |
Generates the report without the filter condition(s) applied. |
When Dynamic filters are defined, they are temporarily added to the report definition prior to generating the report, and when the report is completed, they are removed.