How to Use Filter Criteria in Roll Up Summary Field in Salesforce

The Roll up summary field in Salesforce permits the users to perform the calculation on the relation records in a parent-child relationship and the roll up summary field created on the master detail relationship.

The roll up summary field is used to calculate values like sum, count, min, max, or average of the child record and show the result on the parent records.

The filter criteria in roll up summary field permit the users to define which child record we include in the calculation.

In this Salesforce tutorial, we will learn how to use the filter criteria in the roll-up summary in Salesforce.

For learning this process you have come to the right place and we learned this topic in both the editions of Salesforce Lightning and Salesforce Classic.

How to use the filter criteria in the roll up summary field in Salesforce Lightning

Here we will learn how to use the filter criteria in the roll up summary field in Salesforce Lightning. Let us take an example, Suppose there is a software company managing a sales team and I am working in this company and this company uses the salesforce.

Here we use the two custom objects called account and opportunity. The account object represents the customers and the opportunity object represents the sales that are done by the customers.

There is a master-detail relationship between the account and the opportunity, where one account can connect with multiple opportunities. Here we can create a roll up summary field on the account object to calculate the total amount of closed won opportunities with the particular product type for each account.

Here we use the field criteria in this roll up summary field, the stage is equal to closed won. So here we are only considering the closed won opportunities for the stage field.

Here are the following steps:

1. Our Salesforce lightning version is open when we click on the Salesforce lightning account and then click on the setup option that is present under the gear icon. After that select the object manager tab that is present under the setup page on the nav bar.

2. We want to select the account object from the nav bar, and our account object is present in the first position but if any of the objects are not present at the top so enter the object name in the search box. So click on the account object.

How to use the filter criteria in the roll up summary field in Salesforce

3. Here we can see the details related to the account object. We can see the Fields and Relationships option present on the left side of the page. Click on the Fields and Relationship option.

4. After clicking on the field and relationship, the Fields and Relationships page is open. Under this page, there are lots of fields created. But we want to create a new field. So for this, we click on the new button.

See also  How to Make Date Field Required in Salesforce

The new data type page is open. Under this page, you can see that lots of data types are present. Here we select the roll-up summary data type.

How to use the filter criteria in the roll up summary field in Salesforce Lightning

5. The account’s new custom field page is open. Now enter the details, first fill the field label as Total amount of closed won opportunities and after that, fill the field name by simply clicking on the field, and the field name is automatically filled, then fill the description if you want to fill otherwise leave the field the same and click on the next button.

Use the filter criteria in the roll up summary field in Salesforce

6. Now we come to our next step which is to define the summary calculation. First, select the object to summarize and we can see the account master object then select the summarized object as opportunities.

7. After that select the roll-up type and here select the sum checkbox, this is used to calculate the sum of the Total amount of closed won opportunities field value on a child record. After selecting the sum function then select the files to aggregate option and here we are selecting the amount.

Use the filter criteria in the roll up summary field in Salesforce Lightning

8. After that select the filter criteria, here we can see two options are present first one is all records should be included in the calculation, and the second one is that only records meeting certain criteria should be included in the calculation and here we are choosing the second option.

9. After selecting the only records meeting certain criteria that should be included in the calculation, we can see the field criteria shown. Now apply the formula here, first select the field and here we choose the stage field and then choose the equal operator, and after that choose the value as closed won and then click on the next button.

Salesforce use the filter criteria in the roll up summary field

10. Now we move to our next step which is to establish field-level security that can select the profiles to which we want to grant edit access to this field via field-level security. The field will be hidden from all the profiles if we do not add it to field-level security and then click on the next button.

Salesforce Lightning use the filter criteria in the roll up summary field

11. Now add this field to the page layout. Select the page layouts that should involve this field. This field will be added as the last field in the first 2-column section of these page layouts.

12. The field will not appear on any pages if we do not select a layout. To change the location of this field on the page, we will need to customize the page layout and then click on the save button.

How to use filter criteria in the roll up summary field in Salesforce

13. Click on the App Launcher, and enter the sales in the search box. The sales come at the top, click on the sales option. The Sales page is open. Under this Sales page, there are lots of objects present on the nav bar and here we are selecting the account object.

14. The account record page is opened. Under this page, we can see account records are saved. We can see under this account record page lots of records are already created and here we are selecting the Cathrine Gusikowski record.

See also  How to Set Visible Lines for Text Rich Field in Salesforce

15. Our account Cathrine Gusikowski record page is open and under this page, we can see the details related to the account Cathrine Gusikowski.

16. We can see the Total amount of closed won opportunities field which is the roll-up summary field that calculates the total amount of closed won opportunities that are present inside the Cathrine Gusikowski record.

17. Here we can see there are 11000 total amounts present inside the total amount of closed won opportunities field.

How to use filter criteria in the roll up summary field in Salesforce Lightning

In this way, we understand how to use the filter criteria in the roll up summary field in Salesforce Lightning. Let’s Proceed further and learn how to use the filter criteria in the roll up summary field in Salesforce Classic.

How to use the filter criteria in the roll up summary field in Salesforce Classic

Here we will learn how to use the filter criteria in the roll up summary field in Salesforce Classic. Let us take a real-life example, suppose there is a retail company based in the United States of America and I am working in this company and managing the sales.

This company uses the salesforce to sell all these products. We want to track the Software opportunity count of opportunities. Here we make sure that our sales instance has the account and opportunity objects.

Here we can create a roll up summary on the account object and the account object represents the customers, on this object we see the total count of the software opportunities. The opportunity object represents sales, and how much sales are done in the opportunity object.

Here are the following steps:

1. When we click on the salesforce account our lightning version is open, but we want to work on the classic version. So to move to the classic version, click on the profile picture, under this profile picture, there is an option, to present a switch to Salesforce Classic. Click on this to switch to the Salesforce Classic version.

2. The drop-down list is open when we click on the username drop-down arrow. Under this drop-down list, we can see that the Setup option is present. Select the Setup option. We can see on the left side of the setup option that is Quick Find box is present. Enter the account in the Quick Find box.

3. The account object comes at the top. Click on the drop-down arrow of the account object the account list is open and under this list the fields option is present. click on this fields option.

How to use the filter criteria in the roll up summary field in Salesforce Classic

4. Our account object page is open, Now scroll to the bottom of the page and here we can see the custom field section under this section.

5. We can see lots of fields are present. But we want to create a new field. So we click on the new button. The new data type page is open. Under this page, you can see that lots of data types are present. Here we select the roll up summary data type. after that Click on the next button.

6. After selecting the rollup summary data type, enter the details that are present. Firstly fill the field labelHere we are filling the field label as Software Opportunity Count and then fill the field name and then clicking on the next option.

Salesforce Classic use the filter criteria in the roll up summary field

7. After filling the information now select the object to summarize. Here we select the opportunity and then select the roll-up type as count and then filter the criteria.

See also  How to Export Data from Salesforce

8. Here we can see two options are present first one is all records should be included in the calculation, and the second one is that only records meeting certain criteria should be included in the calculation and here we are choosing the first option and clicking on the next button.

How to use filter criteria in the roll up summary field in Salesforce Classic

9. After selecting the roll-up type now establish the field level security, that can select the profiles to which we want to grant edit access to this field via field-level security. The field will be hidden from all the profiles if we do not add it to field-level security and then click on the next button.

Use filter criteria in the roll up summary field in Salesforce Classic

10. Now add this field to the page layout. Select the page layouts that should involve this field. This field will be added as the last field in the first 2-column section of these page layouts. The field will not appear on any pages if we do not select a layout.

To change the location of this field on the page, we will need to customize the page layout and then click on the save button.

Salesforce Classic use filter criteria in the roll up summary field

11. After clicking on the saving button the Software opportunity count field is shown in the field and relationship item.

12. Go to the Home tab, and under the Home tab we can see lots of tabs are present on the nav bar here we click on the account tab, and our account object page is open. Under this page, we can see lots of account records are present.

13. Here we want to select one of the records, so we are selecting the Cathrine Gusikowski record. Under this record we can see the software opportunity count field is present, Here we can see there is 1 software opportunity count only.

How to use a filter criteria in the roll up summary field in Salesforce Classic

So with this, we understand how to use the filter criteria in the roll up summary field in Salesforce Classic.

Conclusion:

I hope you read the complete article and get the complete idea related to how to use the filter criteria in the roll up summary field in Salesforce.  I have also explained all the steps of using the filter criteria in the roll up summary field in Salesforce Lightning and Salesforce Classic.

You may like to read: