+ Reply to Thread
Results 1 to 11 of 11

Merge query

  1. #1
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    608

    Merge query

    Hi,
    I've merged two tables in the power query editor, (not as new ) as I just want to add data from the sencond table to the first.
    This works fine and bring in what I want. This may sound stupid but I don't seem to be able to 'Close and load' I just end up with the table unalterd.
    I've tried using 'refresh all'. I could just creat 'as new' but I'd like to know where I'm going wrong.

    RD

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Merge query

    Your title could have been more detailed, but I'll let it go ... this time.

    You cannot merge back to a source table. If you want hands on guidance, then please upload a sample workbook.

    There are instructions at the top of the page explaining how to attach your sample workbook.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    608

    Re: Merge query

    Hi,
    I've attached the simple workbook tables I've been playing around with, the merged data model included, as I said I'm fine with 'merge queries as new', using merge I can get the data into power query and run some transformations, but how to I actually do anything with it. You said you can't merge back to a source table which from what i'm getting seems to be true. But what is the point of the 'merge' button? Anyway thank you for helping, I've been through all the MS pages, or at least think I have and though they acknowledge a difference between ' merge' and 'new' they're not too detailed in their use.
    Thanks,
    RD

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Merge query

    There's nothing attached ... yet.
    You said you can't merge back to a source table which from what i'm getting seems to be true.
    Yes - I know because I've been using PQ for a long time now.

  5. #5
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    608

    Re: Merge query

    Sorry, I wasn't doubting you were right.
    I'll try and re or attach the file, this is more because I'd like to get to the bottom of how to do this rather than some desperate practical need.
    Attached Files Attached Files

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Merge query

    OK - tell me what we are looking at, specifically what you want to do and where the results are meant to be.

    I am afraid this has not clarified anything for me - sorry.

  7. #7
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    608

    Re: Merge query

    Ok,
    Sorry couldn't get back to you yesterday, I'm trying to merge the product ID from table 2 into the table 1, I can do this using the 'merge as new option' and have attached a workbook showing the result, but I'm trying to use the 'merge' option, which from the ms support pages seem to mean you don't create a new table, just add the the data from one to the other, as you would if using vlookup xlook etc.

    Hope that helps,
    And thanks,
    RD
    Attached Files Attached Files

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Merge query

    OK - here's the point: in PQ, the only way to combine the two is to create a new table. You cannot merge one source table with another WITHOUT creating a third table. That's just the way it is, so if you really want to use PQ for this, then this is the work flow you have to accept.

    Based on the sample data, I don't see the need for PQ: it's easy enough to do what you want ON the source table by adding a column and using INDEX MATCH and/or XLOOKUP.

  9. #9
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    608

    Re: Merge query

    Right, well that's solved that. I know the data I sent was simple, it was just for testing things out.
    I was beginning to come to the conclusion that it wasn't possible. I know you've been very patient but in that case what is the 'merge' for if you are going to have to create a new table why not just have the 'merge as new'? I've been playing around with append and that seems to be the same situation.
    Still at least now I know I wasn't doing anything wrong or overlooking a step.
    Thanks for that.
    RD

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Merge query

    Because you can merge multiple tables into one resulting query. If you merge as new every time, you'll end up with a whole set of nested queries.

    So your workflow would be to load your satellite (lookup) tables as connection only, then load your main source table and merge it with each of the connection only queries in turn from the source table's query interface. This is what is then closed and loaded to a new worksheet in your workbook (or wherever you want it).

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of all those who offered help.

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Merge query

    Thanks for the rep.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Merge data in power query
    By Undo in forum Excel General
    Replies: 4
    Last Post: 08-19-2021, 05:42 AM
  2. [SOLVED] Merge Pro tip in Power Query
    By hudson andrew in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-29-2021, 03:53 AM
  3. Power Query Merge only the First Instance
    By c4revolution in forum Excel General
    Replies: 1
    Last Post: 04-13-2021, 04:35 AM
  4. Merge Sheets Power Query
    By morerockin in forum Excel General
    Replies: 8
    Last Post: 04-11-2017, 08:17 AM
  5. Merge several workbooks with something like a query
    By gandreso in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-13-2017, 11:51 AM
  6. Mail Merge Query - Format of Merge Fields in Word
    By carlosbourn in forum Excel General
    Replies: 2
    Last Post: 11-10-2007, 07:11 AM
  7. MS Query merge columns
    By mauddib in forum Excel General
    Replies: 1
    Last Post: 03-31-2005, 10:37 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1