Forum

Merged Query - Repe...
 
Notifications
Clear all

Merged Query - Repeated Values

4 Posts
3 Users
0 Reactions
137 Views
(@zpredmore)
Posts: 2
New Member
Topic starter
 

Hello - I am very new to PQ so apologies if this is a very basic question.  I am attempting to merge data from two tables, one used for actual time spent and another for budgeted time using the task as the link between the tables.  I am running into the following situation:

Actual Hours (Table 1):

Task A - Assistant - 15 hours

Budgeted Hours (Table 2):

Task A - Assistant - 20 hours

Task A - Manager - 30 hours

Task A - Director - 5 hours

Merged Query:

Task A - Assistant 15 hours (Actual) and 20 hours (budgeted)

Task A - Assistant 15 hours (Actual) and 30 hours (budgeted)

Task A - Assistant 15 hours (Actual) and 5 hours (Budgeted)

So as you can see my actuals are being duplicated for each different position that was budgeted on a given task when only one instance of the actuals is correct.

Thank you for any help.

Zach

 
Posted : 19/10/2018 1:18 pm
Alan Sidman
(@alansidman)
Posts: 222
Member Moderator
 

Suggest you upload sample worksheets with tables so that we can test and analyze and offer solution.

 
Posted : 19/10/2018 5:32 pm
(@mynda)
Posts: 4761
Member Admin
 

Hi Zach,

As Alan said, it makes it much clearer, quicker and easier if you can attach a sample file. Thankfully your example was relatively easy and I had a few spare minutes so I created a mock up Excel file for you.

In the attached file you'll see in the 'Source' step of the 'merge1' query that I selected the two 'Task' columns and then selected the two 'Role' columns to match. Hold CTRL to select multiple columns. You'll see Power Query has a 1 and 2 notation on the column headers.

Hope that points you in the right direction.

Mynda

 
Posted : 19/10/2018 7:02 pm
(@zpredmore)
Posts: 2
New Member
Topic starter
 

That did it, thank you!  I had to play around with the different join types too but was able to get it straightened out.  Thanks again.

 
Posted : 20/10/2018 10:24 am
Share: