How to Use Add Filter Logic in Salesforce Report?

As a Salesforce admin, I need to generate an account report to display accounts with the type of ‘account=customer-direct.’ The account rating should be hot, or the account should be from the apparel industry.

To create this type of report, first, we need to apply a filter to each field, and then we can use the add filter logic feature to display the appropriate result in the report.

Here, I will explain filter logic in the Salesforce report and then show you how to add filter logic in the Salesforce report using the above scenario and a step-by-step explanation.

Filter Logic in Salesforce Report

When we have two or more conditions to apply to the report, we can use the add filter logic feature to apply the AND or OR operator. By using AND/OR operators, we can apply complex conditions and filter Salesforce reports.

Adding filter logic helps narrow the report results, ensuring you get the data you need based on multiple criteria.

Example 1: Use Add Filter Logic in Salesforce Report

Here, we will see how to add a filter. When we want any particular value in the report, with that value, other values are optional to each other.

In the following step, I explained how to add filter logic to the Salesforce report using the above example.

  1. Go to “App Launcher” -> Search “Reports” -> Click on Reports. Then click the New Report button.
Salesforce Campaign Report
  1. Go to the All category -> to select a Report Type or search accounts. You can select an object on which you want to create a report -> Select Accounts.
Filter Logic in Salesforce Report
  1. Now, we need to apply filters to each field that we want to display. To add a filter, click on the Filter option, then select fields one by one.
    • Here, you can see I have added the following three fields that I specified in the example.
    • Type = Customer – Direct.
    • Rating = Hot.
    • Industry = Apparel.

After applying the filter, you can see that only three records are displayed that meet the filter criteria. But as per our scenario, we want to display the account type as customer—direct and rating = hot OR industry = apparel.

Use Add Filter Logic in Salesforce Report

4. To achieve that requirement, click on the dropdown arrow. Then click on the Add Filter Logic option.

Add AND/OR Filter Logic in Salesforce Report
  1. Then, you need to enter Logic for the applied filter conditions.
1 AND (2 OR 3)
  1. Type = Customer-Direct.
  2. Rating = Hot. OR 3. Industry = Apparel.
    • Then click on the Apply button.
How to Use Add Filter Logic in Salesforce Report
  1. Now, you can see that only the Customer-Direct value is displayed in the Type column, and because of the OR condition between the Rating and the Industry columns, if any value of them meets the defined criteria, it is displayed in the report.
Salesforce add filter logic

In this way, we can use an add filter logic in the Salesforce report.

Example 2: Use Add Filter Logic in Salesforce Report

For example, when we want to display account records with any value that we entered in the filter criteria, we can use the OR operator to add filter logic. Let’s say you want to display account records with either hot or cold ratings.

  1. Navigate to the report tab and select the object on which you want to create a report. Here, I selected the account object. Then click the Start Report button.
    • You can see all records with the Rating field displayed.
Salesforce Report Add Filter Logic
  1. We need to apply logic for both values separately to display in the report. First, I applied a filter to the rating with cold values. -> Then click on the Apply button.
Salesforce Use Add Filter Logic
  1. Similarly, apply a filter to the Rating with Hot values. Then click on the Apply button.
Use Add Filter Logic in Salesforce
  1. Now, we need to add filter logic with the OR operator to display both field values, Hot and Cold.
  • Click on the Filter Button.
  • If you have applied more than one filter, as I have in the above steps, then only the Add Filter Logic option will be available; otherwise, it will not be enabled. Click on the Add Filter Logic option.
  • 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.
1 OR 2
  • Click on the Apply button.
Add OR filter logic in report Salesforce
  1. You can see all records that are filtered based on rating values with the applied filtered criteria.
Create Report with Add Filter Logic in Salesforce

In this way, we can use the OR operator with an add logic filter in the Salesforce report.

Conclusion

I hope you have got an idea about adding filter logic in a Salesforce report. In that, we have seen why we need to use add logic filter and how we can use AND/OR operators in the logic filter to filter and display the records based on multiple criteria. Then, with the help of an example, I explained how to use add filter logic in the Salesforce report.

You may like to read:

Agentforce in Salesforce

DOWNLOAD FREE AGENTFORCE EBOOK

Start with AgentForce in Salesforce. Create your first agent and deploy to your Salesforce Org.

Salesforce flows complete guide

FREE SALESFORCE FLOW EBOOK

Learn how to work with flows in Salesforce with 5 different real time examples.