Defining multiple filter conditions
You can add as many filters as you want, but each condition narrows the scope of data further, and adds complexity to the filter. Design and test filters with multiple conditions carefully. As you add filter conditions, Report Studio inserts the logical operator And between each filter expression. You can change this operator to Or. You can also add the Not operator to either the And or the Or operator to exclude a small set of data.
When you define more than two conditions, you can use parentheses to group conditions to get the results you expect. For example, A And B Or C is evaluated in that order, so A and B must be true or C must be true to include a data row. In A And (B Or C), B Or C is evaluated first, so A must be true and B Or C must be true to include a data row.
Use Advanced Filter to specify multiple filter conditions, as described in this section. Advanced Filter also displays all the filters for the report table. The procedure to modify and delete filter conditions in Advanced Filter is the same as when modifying and deleting data set level filter conditions in Advanced Filter, described earlier in this document.
When creating filter conditions for a summary table that uses a data model data source, the following conditions apply:
*You cannot use Advanced Filter to filter data in a measure column.
*You cannot use Advanced Filter to filter data in dimension and attribute columns if the summary table already contains a measure column with a defined filter condition.
*You can use Advanced Filter to create filters for dimension and attribute columns in a summary table using a data model data source, if no filter condition is defined on a measure column.
How to define multiple filter conditions
1 In Report Studio, select and right‑click the column that contains the values to filter by, then choose FilterFilter.
2 In Filter, choose Advanced Filter.
3 In Advanced Filter, select Static, if necessary.
Advanced Filter displays the selected column in Filter By. To use a different column, select a new column from the drop‑down list.
4 Define a filter condition as follows:
1 In Condition, select a comparison operator.
2 Specify a value as you did earlier.
3 Choose Add Condition.
The filter condition appears in the Conditions area.
5 Define the next filter condition on Advanced Filter as follows:
1 In Filter By, select another column.
2 Repeat step 4.
In the Conditions area, the second filter condition appears after the first condition, as shown in Figure 11‑9. By default, the second condition is preceded by the logical operator, And.
Figure 11‑9 Advanced Filter displaying two conditions
6 Select a different logical operator, if necessary.
7 If the BIRT design contains aggregate data, do one of the following:
*To recalculate aggregate data values across the filtered data rows, select Recalculate Totals, if necessary.
*To calculate aggregate data for the unfiltered data, deselect Recalculate Totals.
8 To add additional filter conditions, repeat step 4.
9 If you create more than two filter conditions and you use different logical operators, you can use the parentheses buttons to group conditions to determine the order in which conditions are evaluated.
10 Choose Validate to verify the syntax of the filter conditions, then choose Add Filter.
The defined filter conditions appear in the Filters area, as shown in Figure 11‑9. Choose OK.
11 Run the BIRT design to verify that it displays the expected results.