Skip to main content
spencer_engel
Expert ⭐️
April 29, 2019

How to aggregate and merge data in the Rules Engine

  • April 29, 2019
  • 2 replies
  • 596 views
Hi everyone -

I've put together a how-to video that explains how to aggregate data and then merge with another dataset to get everything you need. The use case here is that I want to find the nearest-in-the future close date for an opportunity (a.k.a. MIN Close Date) and then still pull over other key attributes from that opportunity (Amount, Owner ID Name, etc.).

Here's how to do that.



2 replies

Contributor ⭐️⭐️
April 1, 2021

This is great to understand merging data sets, but I believe you should have merged on Account ID and/or Opportunity ID. Doing it the way you did is fine if there are only a few Opps in the same account, but what if you have multiple Opps with the same Close Date? You’ll again just pull a random amount. 

spencer_engel
Expert ⭐️
April 14, 2021

This is great to understand merging data sets, but I believe you should have merged on Account ID and/or Opportunity ID. Doing it the way you did is fine if there are only a few Opps in the same account, but what if you have multiple Opps with the same Close Date? You’ll again just pull a random amount. 

Yeah, that’s a good point and should be considered especially in a use case where a customer may have a whole bunch of opportunity records.