0

I have two queries and I somehow need to get them to work together...

SELECT Owner.Name Salesperson, RecordType.Name, COUNT(Id) FROM Opportunity WHERE CALENDAR_MONTH(CreatedDate) = 1 AND CreatedDate = THIS_YEAR GROUP BY Owner.Name, RecordType.Name ORDER BY Owner.Name ASC

and

SELECT Owner.Name, COUNT_DISTINCT(Id), COUNT(ConvertedDate) FROM Lead WHERE CALENDAR_MONTH(CreatedDate) = 1 AND CreatedDate = THIS_YEAR GROUP BY Owner.Name

What I am trying to achieve is get a list of all the leads that came in for the month with each person and then get a count of each of the Opportunities Types that they created that same month. Both reports run fine by themselves, but marrying them together to get on the same report is proving a bit tricky.

If it makes any difference, I will be creating the report in Conga Composer.

1 Answer 1

0

Unlike SQL, Salesforce does not support Union clause to join 2 different resultset from 2 tables.

You can create separate object, populate the data based on above queries and then finally use that object for mapping with conga reports

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.