Forum

Notifications
Clear all

Merging queries

5 Posts
2 Users
0 Reactions
154 Views
(@kazlewis)
Posts: 24
Eminent Member
Topic starter
 

Hi

I have 2 queries I want to merge but when I do it is bringing in extra information that I don't want. Query 1 lists all leads, query 2 lists all sales. I am trying to do a merge to analyse the leads v sales.  When I merge the 2 queries (using left outer (leads query is my base/first table I am using) and matching students ID nr), my output duplicates the lead row if there have been more than one sale for that person. E.g. student 1 only downloads 1 info pack (lead) but has 3 sales. In my merged report, there are the 3 sales but also 3 lots of lead data alongside the sales when there should only be 1 lot of lead data. Hence I am getting an incorrect outcome in my pivot as it is saying, for this person, there were 3 leads when really there was only 1. 

Any ideas on what I am doing wrong?

Thanks Karen

 
Posted : 07/08/2019 6:11 pm
(@mynda)
Posts: 4761
Member Admin
 

Hi Karen,

You're not doing anything wrong, a Merge is like doing a VLOOKUP, so if you have 3 records in one table then it will return 3 records. I recommend you remove the duplicates in the sales data before you do the merge.

Mynda

 
Posted : 08/08/2019 7:30 pm
(@kazlewis)
Posts: 24
Eminent Member
Topic starter
 

Thanks Mynda. Unfortunately some people make more than one sale against one lead. So then I have only the one lead but 3 sales and, as you have said, it adds the same lead data against each sale for that person. Any other suggestions?

Karen

 
Posted : 09/08/2019 10:21 pm
(@mynda)
Posts: 4761
Member Admin
 

The suggestion is to remove the 2 extra sales so each sales person only has one sale for the purpose of the merge. If you provide a sample file I'll show you what I mean. Please add your 'desired result' example to this sample file so that I can make sure I fully understand how you want the end result to look.

 
Posted : 10/08/2019 3:00 am
(@kazlewis)
Posts: 24
Eminent Member
Topic starter
 

Thanks Mynda. I think I have sorted this out now. Thanks for your help. 

Karen

 
Posted : 12/08/2019 3:07 pm
Share: