[SalesForce] Roll-up Summary field | OR filter criteria

I have a Roll-Up Summary (SUM Opportunity Product) field. The field gives an option to Only records meeting certain criteria should be included in the calculation which is really good because it allows me to filter but the filter criteria only has AND option but not an OR. Why is that? And how can I workaround it? Please assist.

Best Answer

There's a couple of ways to work around this limitation.

One option, using native functionality, is to decompose your OR Roll-Up Summary into more than one Roll-Up Summary, each of which has only a single criterion, and then using a separate formula field to sum those component Roll-Up Summaries. The downside to this approach, of course, is that you consume more of your scarce limit for Roll-Up Summaries.

Another option would be to use Declarative Lookup Rollup Summaries, which (belying its name) can also work on master-detail relationships and which supports the full breadth of SOQL in defining the set of records to be included in the rollup.