+ Reply to Thread
Results 1 to 4 of 4

Convert existing query to an append query?

  1. #1
    Forum Contributor
    Join Date
    03-08-2011
    Location
    Lubbock, TX, USA
    MS-Off Ver
    MS OFFICE 365 EXCEL, OUTLOOK, WORD, POWERPOINT
    Posts
    196

    Convert existing query to an append query?

    Hi. I have a functioning query. Now I would like to be able to do a daily .xls file (same name, same format obviously) and append to the data already there. I'm new to this so any advice or tutorial link or even the best keyword searches would be gratefully accepted.

    Here is the M code if that helps.

    Please Login or Register  to view this content.
    I am not sure if I need to make a new query or if this can be "upgraded" for lack of a better term. Thanks for looking.

  2. #2
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,505

    Re: Convert existing query to an append query?

    Two options:

    1. After refresh, copy the query to a combined sheet with VBA. You can append it to the existing table everytime.
    2. If you don't want to use VBA, you need a workaround with the help of the datamodel. To achieve this, you need to add a table to your data model, retrieve it in a worksheet (you can hide this sheet), and then reference this table in Power Query. It sounds more complicated than it actually is.

    Attached an example with the datamodel (option 2). Eventually, you can hide the datamodel sheet.
    For testing, try adding values to the blue table. Then hit "Refresh All" and see what happens. The green table next to the blue table will grow. Already loaded records stay in the table as well
    Attached Files Attached Files
    Last edited by JEC.; 11-29-2024 at 04:13 AM.

  3. #3
    Forum Contributor
    Join Date
    03-08-2011
    Location
    Lubbock, TX, USA
    MS-Off Ver
    MS OFFICE 365 EXCEL, OUTLOOK, WORD, POWERPOINT
    Posts
    196

    Re: Convert existing query to an append query?

    Oh wow. Thanks. I am closer to visualizing how it will work. The table my M-code referenced is a connection only so that I could marry the key fields with other tables. The final product is a Merge between the current inventory, the current transactions, and any current comments. So I should create a table in excel that matches what I currently have stored in the datamodel. Then reference THAT new table in the query that is in the data model. change the connection only to a table in excel proper. Did I get that right? I really appreciate the help. Thanks again.
    Last edited by AliGW; 12-01-2024 at 01:55 AM. Reason: Please don't quote unnecessarily - use the Quick Reply button instead. Please review the forum guidelines.

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365
    Posts
    18,597

    Re: Convert existing query to an append query?

    To answer the question posed in post #3, it would be helpful to see a sample file.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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] Power Query: Add a new query to an existing Query that already has multiple queries
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-06-2023, 04:33 PM
  2. [SOLVED] Append CSV query to existing table. Is it possible?
    By DMA in forum Excel General
    Replies: 4
    Last Post: 03-11-2021, 04:19 PM
  3. [SOLVED] Convert SELECT query to DELETE query
    By Jan7219 in forum Access Tables & Databases
    Replies: 5
    Last Post: 11-16-2020, 11:27 AM
  4. [SOLVED] Power Pivot/Query Convert Existing Table to Query
    By trisoldee in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 08-23-2019, 04:27 PM
  5. Power query append?
    By pedroc in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-08-2018, 06:08 PM
  6. Understanding Query Design with respect to building an Append Query
    By swade730 in forum Access Programming / VBA / Macros
    Replies: 1
    Last Post: 03-18-2016, 01:00 PM
  7. Can I use MS Query in Excel like an Append Query in Access
    By Sam Wardill in forum Excel General
    Replies: 0
    Last Post: 04-11-2006, 09:45 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