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.

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

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.

4. Here, you can see, without any comparison before applying the filter, both fields displayed with values as we discussed in the above example. We will apply the greater-than-conditional operator to these fields.

5. To apply the condition to the report, click on the Filter option.
- Field: As I explained, we can select only three types of fields to compare the values. Here, I have selected This Year’s Revenue, which is the currency field.
- Operator: In the Operator option, we need to add conditions as per our requirement. Here, I have selected Greater than Operator.
- Type: In the Type field, you have two options –
- Value: In this option, you can directly enter any particular value that you want to compare with.
- Field: In this option, firstly, any other field that is related to the field you want to compare with will populate. You can change it by clicking the lookup icon.
- Here, in the Type field, I have selected the Last Year Revenue field.
- Then click on the Apply button.

6. The condition that we applied was This Year Revenue > Last Year Revenue. Now, the records displayed are those that match the applied condition.

This is how can filter reports by comparing fields-to-fields in Salesforce Lightning.
Conclusion
I hope you have got an idea about field comparison with field-to-field filters, what is meant by comparing field values, what are the uses of comparing two fields, and what points should be remembered.
Additionally, we have seen how to filter reports by comparing fields-to-fields in Salesforce Lightning.
You may like to read:
- How to Subscribe or Schedule Reports in Salesforce?
- Edit Fields Inline on the Report Page in Salesforce
- How to Delete Schedule Report in Salesforce
- How to create Log a Call Report in Salesforce
I am Bijay Kumar, the founder of SalesforceFAQs.com. Having over 10 years of experience working in salesforce technologies for clients across the world (Canada, Australia, United States, United Kingdom, New Zealand, etc.). I am a certified salesforce administrator and expert with experience in developing salesforce applications and projects. My goal is to make it easy for people to learn and use salesforce technologies by providing simple and easy-to-understand solutions. Check out the complete profile on About us.