The following example uses the Filters tab to select all active accounts
in three states: MA, NH, and ME. The SQL equivalent of this is:
…where
Active_c =’Y’
and (BillingState=’MA’ or BillingState=’NH’
or BillingState=’ME’)
If you want to create a filter condition
for the Active__c field, click Add
Condition.
In the Query Condition
dialog, select "Active__c” from the Field list,
select "=” from the Comparison Operator list, then type "Y”
(including double quote characters) in the expression edit box.
Click OK
to save the condition and return to the Filters tab of the Configure Source
dialog box.
If you want to create a filter condition
for BillingState field, click Add
Condition.
Select "BillingState” from the
Field list, select "=” from the Comparison Operator list, then type
"MA” (again, with double quotes — all strings must include double
quotes), then click OK.
Notice in the tree control on
the Filters tab that you now have an Account node with an "and” node
below it, and the two conditions that you just created nested below the
"and” node. This tells you that the results of the "Active__c”
and "BillingState” conditions will be "anded” together.
Add the other two conditions
for NH and ME. Because we want to include Account records from the 3 different
states, we want to create a set of "or” conditions. To do this:
Select the BillingState=”MA” node
in the tree and click the "right arrow” button. This will create
a new "and” node and will move the BillingState=”MA” condition under
the new node.
Select the new "and” node
above BillingState=”MA” then click the Operator radio button labeled "or”.
The result is displayed as:
With the "or” node
selected, add two additional BillingState conditions for "NH” and
"ME” as described in step 2 above. The resulting filter will be displayed
as:
Note: Another way
to create this filter would be to add all 4 of the conditions under the
"and” node, multiselect the 3 BillingState conditions, then click
the Operator radio button labeled "or”.