WebFOCUS Online Help > Managed Reporting Developer > Creating Reporting Objects > Filters
In this section: How to: Reference: |
Filters enable users to quickly select predefined criteria that limit data included in a report or graph. Filters are selection criteria (WHERE statements) that you create for users, who then select the filters needed to limit the data in a report or graph, without having to create their own selection criteria.
In order to create a filter, you must create the filter group and define the filters that make up the group.
In Developer Studio, right-click the Filters folder and, in the Reporting Object window, select New Group.
The New Filter Group dialog box opens.
You should make the filter group name as explicit as possible, because your users depend on this name to select the correct filter to apply to their reports.
You return to the Reporting Object window. The filter group folder appears below the Filter component folder.
In Developer Studio, right-click the filter group folder to which you want to add a filter and select New Filter.
The New Filter dialog box opens.
You should make the filter names as explicit as possible, because your users depend on these names to select the correct filter to apply to their reports.
The Expression Builder dialog box opens.
For details about building the filter expression, see Using the Expression Builder.
WebFOCUS saves the filter and returns you to the Reporting Object window. The new filter appears below the filter group folder.
If you have finished working with the components of the Reporting Object, remember to click Done in the Reporting Object window to save the changes.
Note: Syntax and error checking are not performed on the commands you enter until the Reporting Object is executed.
When using Amper Auto prompting, there are scenarios when users are prompted to supply amper variable values in filters they did not select, or users are not prompted to supply amper variable values in filters they did select. For more details, see Other Component Considerations With Amper Auto Prompting.
To define a filter, you use the Expression Builder dialog box to specify a field, a relational operator (for example, Is Equal to, Is Greater Than), and a Compare Type.
The following image shows the CAR fields window next to the Expression Builder dialog.
The Compare Type you select determines the value you enter. The filter definition compares this value to the values stored in the selected field. If the relation between the field value and the specified value is true, the field value appears in the report.
You can select one of the following Compare Types:
Type a value in the Value box, or click the Values button to choose from a list of actual values. This value depends on the Compare Type you selected in the previous step.
The following table describes the Compare Type usage.
If you selected... |
Then... |
---|---|
Value |
Type a literal value or click the Values button to select from a list of actual data source values for the selected field. |
Parameter (Variable) |
In the Value box, specify the name of the variable. |
Another Field |
In the Fields list box, select a field. |
WebFOCUS saves the filter and returns you to the Reporting Object window. The new filter appears below the filter group folder.
If you have finished working with the components of the Reporting Object, remember to click Done in the Reporting Object window to save the changes.
Note: Syntax and error checking are not performed on the commands you enter until the Reporting Object is executed.
Your manager wants users to be able to ascertain which store products are the best sellers. Instead of defining selection criteria, which restrict the data a user can access, you will create two filters: one for coffee products and the other for food products. Users can then select either Coffee Products or Food Products to see which items sold more.
The following image shows Reporting Objects window with the Filters component expanded listing two filters, Coffee Products and Food Products.
The following examples illustrate how to create these filter groups and filters. By using these examples as a guideline, you can create multiple filter groups that contain multiple filters. Your users can then combine filters from different groups to create complex selection criteria that allow only specific data in a report or graph.
To define a filter group for Products filters:
In Developer Studio, right-click the Filters component folder and select New Group.
The New Filter Group dialog box opens.
A group folder labeled Products appears below the Filters folder.
The following is an example of creating a filter for coffee products.
In Developer Studio, right-click the Products folder and select New Filter.
The New Filter dialog box opens.
The Expression Builder dialog box opens.
You return to the Reporting Object window.
The Coffee Products filter appears below the Products group folder.
The following is an example of creating a filter for food products.
In Developer Studio, right-click the Products folder and select New Filter.
The New Filter dialog box opens.
The Expression Builder dialog box opens.
You return to the Reporting Object window.
The Food Products filter appears below the Products group folder.
WebFOCUS |