How to Filter Reports by Compare Field-To-Field in Salesforce

In Salesforce, sometimes we want to compare one field value with another field; with the name of compare, you must want to know the difference between them and display a particular result after comparison.

Compare field-to-field value filter only works in Salesforce Lightning.

In this Salesforce tutorial, we are going to learn about field comparison with field-to-field filters, what is meant by comparing field values, and what are the uses of comparing two fields. Additionally, we will see how to filter reports by comparing field-to-field in Salesforce Lightning.

Compare Fields Value in Salesforce

What is meant by comparing field values in the Salesforce Report?

In Salesforce now it is possible to compare field-to-field filter values in different fields available in Salesforce Report. By using a conditional operator, we can compare fields and display results as per our requirements.

What are the uses of comparing two fields in the Salesforce Report?

Following are the uses of comparing two fields –

  • Using comparison helps the user to get the result of which condition he applied.
  • We can easily differentiate fields and choose the result that we want by using comparison.
  • This enables the user to narrow down our data and makes it more straightforward to analyze data. It makes our task easier.

Points to be remembered

  • Compare field-to-field value filter only works in Salesforce Lightning.
  • This only works in these datatypes fields – Number, Currency, Date, and DateTime.
  • In a single report, you can have up to four field-to-field value filters.
  • You can compare only the same data type fields with each other.

Example

Suppose in the Account Object, we have two fields: Last year’s revenue and This year’s revenue. In the report, you need to display only those reports that This year’s revenue should be greater than Last year’s revenue.

We can do this using a conditional operator. In the next section, we will see how we can implement this example.

How to Filter Reports by Comparing Fields-To-Fields in Salesforce Lightning

Using the above example, we will see how to add filters to reports by comparing field-to-field in Salesforce.

1. Go to the Home page, click on the Home tab, and then you will see the App Launcher option. Click on App Launcher.

In the search box Search the Report, and click on Report option.

Create Report to compare fields in Salesforce

2. To create the new report, there is a button in the right corner; click on the New Report button.

Create New Report to compare fields in Salesforce

3. Now, you need to select the Object to create the report. To select the object, you will see the Category option on the left side of the screen. You need to click the All option, and you can select Account Object directly or search for the object.

Then click on the Start Report button.