How to define multiple filter conditions
The following procedure shows how to define multiple filter conditions using Advanced Filter.
1  
2  
3  
Advanced Filter displays the selected column in Filter By. To use a different column select a new column from the drop-down list.
4  
1  
2  
*
*
*
*
*
*
3  
The filter condition appears in the Conditions area.
5  
1  
2  
3  
*
*
*
*
*
*
4  
In the Conditions area, the second filter condition appears after the first condition, as shown in Figure 5-12. By default, the second condition is preceded by the logical operator, And.
6  
7  
*
*
Figure 5-12  
8  
9  
10  
The defined filter conditions appear in the Filters area, as shown in Figure 5-12. Choose OK.
11  
Selecting a logical operator
As you add each filter condition, the logical operator And is inserted between each filter condition. You can change the operator to Or. The And operator means both filter conditions must be true to include a data row in the report. The Or operator means only one condition has to be true to include a data row. You also can add the Not operator to either the And or Or operators to exclude a small set of data.
For example, the following filter conditions return only sales data for classic car items for the San Francisco office:
Sales Office = San Francisco
And Product Line = Classic Cars
The following filter conditions return all sales data for the San Francisco and Boston offices:
Sales Office = San Francisco
Or Sales Office = Boston
The following filter conditions return sales data for all product lines, except classic cars, for the San Francisco office:
Sales Office = San Francisco
And Not (Product Line = Classic Cars)
Specifying the evaluation order
BIRT Studio evaluates filter conditions in the order in which they appear. If 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. To illustrate the difference a pair of parentheses can make, compare the following examples.
The following filter contains four conditions and none of the conditions are grouped, as shown in the example in Figure 5-13:
Sales Office = San Francisco
and ProductLine = Classic Cars
and Total >= 5000
or Profit >= 2500
Figure 5-13  
Although the filter specifies the San Francisco office and the Classic Cars product line, the report displays data for other sales offices and product lines.
Without grouped conditions, the filter includes rows that meet either conditions 1, 2, and 3, or just condition 4.
The following filter contains the same four conditions, but this time the third and fourth conditions are grouped, as shown in the example in Figure 5-14:
Sales Office = San Francisco
and ProductLine = Classic Cars
and (Total >= 5000
or Profit >= 2500)
This time, only two rows meet the conditions. The Sales Office = San Francisco and ProductLine = Classic Cars conditions must be true, and either theTotal >= 5000 condition or the Profit >= 2500 condition is true.
Figure 5-14  

Additional Links:

Copyright Actuate Corporation 2013 BIRT iHub 2