How to use OR Filter in Salesforce Report

In this tutorial, you will learn about what is OR filter, and when we can use it additionally we will see step by step How to use OR Filter in Salesforce Report in the Salesforce Lightning and Salesforce Classic.

What is the OR filter in Salesforce?

In the Salesforce filter report, we cannot use the OR operator directly like equals to, less than, greater than, etc. To achieve this condition we can use filter logic.

In Salesforce report OR filter is very useful for creating the more complex and flexible report criteria.

Example 1: When we want to show records of multiple values on the same field that time we can use the OR filter. For example, you want to show Account records where the “Rating” is either “Hot” or “Clod“.

Example 2: When we want to show records based on different field values. For example, you want to show Lead records where the “Company” field is “TNR Corp.” or “Lead Status” is “Working Connected“.

I will show you how to use OR filter in the Salesforce report with the same examples.

How to use OR Filter in Salesforce Report in Salesforce Lightning

We will see 1st example and using the following steps how to create OR filter in the Salesforce report.

See also  How to Create Report With Report Chart in Salesforce

1. Go to “App Launcher” -> Search “Reports” -> Click on Reports.

Create OR filter on Report

2. click the “New Report” button to create a new report.

Create New OR Filter Report

3. Go to All category -> to select a report type, Search “Account“, you can search on which object you want to create a report. -> Select Account.

OR Filter Report in Salesforce

4. You can see all records with the Rating field displayed.

OR Filter in Salesforce

5. For the display of both the different values based on the same field we need to apply both logic separately.

Here 1st I have filtered the Rating with Cold values. -> Then click on the Apply button.

Set Rating as cold in Salesforce report

6. Similarly, After applying 1st logic then I filtered the Rating with Hot values. -> Then click on the Apply button.

Set Rating as Hot in Salesforce report

7. Now we want to add OR logic for displaying both field values Hot and Cold.

  • Step 1: Click on the Filter Button.
  • Step 2: If you have applied more than one filter like I have applied in the above steps then you will see the Add Filter Logic Option otherwise it will not enabled. -> Click on the Add Filter Logic option.
  • Step 3: Enter the OR filter logic, in my case, I want a Rating of either “Cold” or “Hot“. So I have entered 1 OR 2 logic.
  • Step 4: Click on the Apply button.
Add OR filter logic in report Salesforce

8. You can see all records will filtered based on different rating values with the same filled.

Results OR Filter in Salesforce

This is how we can add OR filter logic in the Salesforce Lightning.

See also  How to Pass a Record ID into Salesforce Flow

How to use OR Filter in Salesforce Report in Salesforce Classic

We will see 2nd example and using the following steps how to create OR filter in the Salesforce report.

1. Go to All Tabs -> You will see the “Reports” tab -> Click on the Reports tab.

OR Report Filter in Salesforce Classic

2. Then click on the “New Reports” button to create a new report.

Create OR Filter Report in Salesforce Classic

3. Select the Object, here I have selected “Leads” Object -> Click on the Create button.

OR Filter in Salesforce Classic

4. Here, you can see when I have created a report of Leads details and all records with Company and Lead Status have been displayed.

Add OR Filter in Salesforce Classic

5. Here, we want TNR crop company records. To apply a filter -> Click on the Filter option -> Select the field “Company/Account“.

6. Select the Operator Contains -> Company name “TNR crop“. -> Click the OK button.

add Company logic in Salesforce report

5. Similarly to filter the Lead Status as Working-Contacted add a filter for this.

add Source logic in Salesforce report

6. To add the Filter Logic, click on the Filter option -> Then click on the Add button -> And select the Filter Logic option.

Add OR logic in report in Salesforce

7. If you have applied more than one filter as I have applied in the above steps then you can add OR filter logic.

Enter the OR filter logic, in my case, I want a Company that is equal to TNR crop or Lead Status as Working-Contacted. So I have entered 1 OR 2 logic.

Apply OR logic in Salesforce Classic

8. Now you can see we have only added logic for TNR Crop company but other companies also displayed it done because we have added lead status Working-Contacted and vise varsa.

Results OR Filter in Salesforce Classic

This is how we can add OR filter logic in the Salesforce Classic.

See also  Contains Filter in Salesforce Report

Conclusion

I hope in this article you have got an idea about what is OR filters in the Salesforce report also we have seen examples of OR filters and we have seen step-by-step how to add OR filters in Salesforce report both in Salesforce Lightning and Salesforce Classic.

You may like to read