You are here:
Add Filter Logic to a Report
Filter logic governs how and when filters apply to your report.
Required Editions
| Available in: both Salesforce Classic and Lightning Experience |
| Available in: Essentials, Group, Professional, Enterprise, Performance, Unlimited, and Developer Editions |
| User Permissions Needed | |
|---|---|
| To create, edit, and delete reports: | Create and Customize Reports AND Report Builder |
| To create custom list views: | Read on the type of record included in the list |
| To create, edit, or delete public list views: | Manage Public List Views |
After adding a filter to your report, the filter is numbered. Your first filter becomes Filter 1 and your second filter becomes Filter 2. You apply filter logic based on these numbered filters.
For example, let’s say you have a report of Accounts with fields like State, Annual Revenue, and Industry. Your report has these filters:
- State includes California, Arizona, Nevada
- Industry equals Banking
- Annual Revenue greater than 1000000
These three filters cause your report to return accounts in California, Arizona, or Nevada in the Banking industry with annual revenue greater than $1,000,000. But what if you want accounts only in California, Arizona, or Nevada AND in the Banking industry, OR with annual revenue greater than $1,000,000.00? Add filter logic to your report.
-
From the Lightning Report Builder, click
Filters |
| Add Filter Logic.
From the Salesforce Classic Report Builder, click Add | Filter Logic.
-
Enter each filter line number, separated by a filter logic operator.
For example,
(1 AND 2) OR 3finds records that match both Filter 1 and Filter 2, or Filter 3.Here’s a complete table of filter logic operators:
Operator Definition ANDFinds records that match both values.
1 AND 2ORFinds records that match either value.
1 OR 2For example, Filter 1 is
Amount is greater than “$50,000”. Filter 2 isType equals “New Business”. If you set the filter logic as1 Or 2, the report returns records that are either high value or new opportunities.NOTFinds records that exclude values.
For example, Filter 1 is
Industry equals “Biotechnology”. If you set the filter logic asNot 1, the report returns records that aren’t equal to Biotechnology. - Click Save.
Now your report shows Banking industry accounts in California, Arizona, and Nevada with any amount of revenue, and any account with annual revenue above $1,000,000.00.
- You can’t apply filter logic to standard report filters.
- You can add up to 20 custom filters.
- Filter logic isn't available for all filters. For example, you can’t use a filter for rollup summary fields.
- On reports where object A may or may not have object B, you can't use the OR condition to filter across multiple objects. For example, if you select Account Name starts with M OR Contact First Name starts with M, an error message informs you that your filter criteria are incorrect.
- If your field filters use these fields, you can’t include filter logic.
- Topics
- Description
- Any Address Line 1, Address Line 2, or Address Line 3 fields
- Forecast Category
- Campaign: Member Type
- User: Profile Name
- Login Status
- Custom long text area fields
- Old Value or New Value fields
- Composite fields, such as Full Name

