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.


Top of page

x
Procedure: How to Create the Filter Group
  1. Expand the Reporting Object that you want to add the filter group to.
  2. In the browser, select the Filters folder and click New in the Reporting Object window.

    In Developer Studio, right-click the Filters folder and, in the Reporting Object window, select New Group.

    The New Filter Group dialog box opens.

  3. In the Name box, type a descriptive name for the filter group folder.

    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.

  4. Click OK.

    You return to the Reporting Object window. The filter group folder appears below the Filter component folder.


Top of page

x
Procedure: How to Define the Filter
  1. In the browser, select the filter group folder to which you want to add a filter.

    In Developer Studio, right-click the filter group folder to which you want to add a filter and select New Filter.

  2. In the browser, click New in the Reporting Object window.

    The New Filter dialog box opens.

  3. In the Name box, type a descriptive name for the filter and click OK.

    You should make the filter names as explicit as possible, because users depend on these names to select the correct filter to apply to their reports.

    The Expression Builder dialog box opens.

  4. Use the Expression Builder to build the filter.

    For details about building the filter expression, see Using the Expression Builder.

  5. When you have created the filter, click OK.

    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.


Top of page

x
Reference: Filters Considerations With Amper Auto Prompting

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.


Top of page

x
Using the Expression Builder

How to:

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 CAR fields window next to the Expression Builder dialog box

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:



x
Procedure: How to Build an Expression for a Filter
  1. In the Fields list box, select a field.
  2. From the Relations box, select a relational operator.
  3. Select a Compare Type.
  4. Specify a value to compare to the selected field.

    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.

  5. When you have created the filter, click OK.

    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.



Example: Creating Two Filters

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.

Reporting Objects window

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.



Example: Creating the Products Filter Group

To define a filter group for Products filters:

  1. Expand the Reporting Object to which you want to add filters.
  2. In the browser, select the Filters component folder and, in the Reporting Object window, click New.

    In Developer Studio, right-click the Filters component folder and select New Group.

    The New Filter Group dialog box opens.

  3. In the Filter Group Name box, type Products.
  4. Click OK.

    A group folder labeled Products appears below the Filters folder.



Example: Creating a Filter for Coffee Products

The following is an example of creating a filter for coffee products.

  1. In the browser, select the Products folder and, in the Reporting Object window, click New.

    In Developer Studio, right-click the Products folder and select New Filter.

    The New Filter dialog box opens.

  2. In the Filter Name box, type Coffee Products and click OK.

    The Expression Builder dialog box opens.

  3. In the Expression Builder dialog box, perform the following:
    1. In the Fields list box, select Products.
    2. In the Relations list box, select Is EQUAL to.
    3. Click Values, select Coffee, and click Add.
  4. Click OK.

    You return to the Reporting Object window.

    The Coffee Products filter appears below the Products group folder.



Example: Creating a Filter for Food Products

The following is an example of creating a filter for food products.

  1. In the browser, select the Products folder and, in the Reporting Object window, click New.

    In Developer Studio, right-click the Products folder and select New Filter.

    The New Filter dialog box opens.

  2. In the Filter Name box, type Food Products and click OK.

    The Expression Builder dialog box opens.

  3. In the Expression Builder dialog box, perform the following:
    1. In the Fields list box, select Products.
    2. In the Relations list box, select Is EQUAL to.
    3. Click Values, select Food, and click Add.
  4. Click OK.

    You return to the Reporting Object window.

    The Food Products filter appears below the Products group folder.


WebFOCUS