function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jerry_jJerry_j 

How to join multiple objects in SOQL (or with a report)?

I'm trying to create a version of the Campaign Influence Report.

What I basically want is, for a given Campaign, I want to get a list of distinct accounts that are tied to the contacts in the Campaign Members. From that list, I want to get all of the open opps for that account as well as all of the opps that have closed since the start of the campaign.

The probelm I'm having is that if the Campaign Members contain, for example, 3 contacts from the same account, and that account has 2 qualifiying opps, I only want to see 2 opps, not 2x3.  I basically don't care about the contacts, I just want the opps.

I could do this easily in SQL, but I'm having troubles building this in SOQL or in Reports.

Any thoughts??

thanks!