+ Reply to Thread
Results 1 to 6 of 6

Data moves when query refreshed / Aligning manually entered data with external data

  1. #1
    Forum Contributor
    Join Date
    08-18-2018
    Location
    Canada
    MS-Off Ver
    365
    Posts
    151

    Data moves when query refreshed / Aligning manually entered data with external data

    I have same problem with this and tried all the possible answer but still unsolved, can anyone help me?

    I have an Access Database that is linked in excel, in that workbook I added new column adjacent to the external table that I manually entered the values. When the query in the database change and the external table refreshed, the values in the new column remains. Is there a way that the new column values also shift when the database refreshed?


    https://chandoo.org/forum/threads/da...efreshed.1926/

    https://www.mrexcel.com/forum/excel-...ata-query.html

    https://www.mrexcel.com/forum/micros...dding-row.html

    Tried external data properties options like preserve columns sort/filter/layout, preserve cell formatting and adjust column width, insert cells, insert entire rows, overwrite existing cells, but still unable to solve this problem.

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,885

    Re: Data moves when query refreshed / Aligning manually entered data with external data

    There is no way to retain row relationship between queried table and manually entered column.

    Only way to retain relationship is via formula.

    If it must be manually entered... there are few ways to handle it.

    1st Method
    1. Using Get & Transform (PowerQuery/PQ), bring in the data from MS Access. Add Index column (or unique identifier column) if there isn't one already. Add as connection only for now.
    2. Add blank query. Use List function to create list of manual entry and corresponding Index/UID.
    Ex:
    Please Login or Register  to view this content.
    3. If you want to update record, you can just change Note value. If new item is to be added, you can add another [ColumnName=Value, Column2=Value] (i.e. Record).
    4. Back in original query use "Merge" operation to Left join 2nd to original using left join. Load back to sheet.

    Note: You may find maintaining 2nd list cumbersome. If that is the case just use Excel table as source and update info there.

    2nd method:
    If using any other query. You may want to create separate table with unique ID & Manual column (in Excel). Then link it to table using INDEX/MATCH or other lookup formula. Formula column should auto update with data brought in.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Forum Contributor
    Join Date
    08-18-2018
    Location
    Canada
    MS-Off Ver
    365
    Posts
    151

    Re: Data moves when query refreshed / Aligning manually entered data with external data

    I tried this step by step and it seems that this is the 1st method you gave? however my columns get duplicated. I don't know where I get wrong, so I just delete it.

    Also how do I add unique identifier column or count? Is this necessary? So that everytime the external data will refresh, new rows/values will be added at the bottom of the table?

    Does adding a formula? it will vanish once the external data is refreshed. How it will be retain?

    https://www.youtube.com/watch?v=duNY...ature=youtu.be
    Last edited by dummy777; 10-03-2019 at 08:12 AM.

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,885

    Re: Data moves when query refreshed / Aligning manually entered data with external data

    Without sample of your M query code, it's hard to say what you did wrong.

    Marcel's method is more automated than what I suggested, instead of using List converted to table, he uses Previous Query to join onto original.

    Post your M code and screenshot of your query table, before and after the operation. I can probably point out where you went wrong.

  5. #5
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,885

    Re: Data moves when query refreshed / Aligning manually entered data with external data

    Posted in wrong thread.

  6. #6
    Forum Contributor
    Join Date
    08-18-2018
    Location
    Canada
    MS-Off Ver
    365
    Posts
    151

    Re: Data moves when query refreshed / Aligning manually entered data with external data

    this is my before code, i haven't change yet the #"Changed Type" to PQOutput
    Please Login or Register  to view this content.
    Updated to PQOutput
    Please Login or Register  to view this content.


    this is my after code:
    Please Login or Register  to view this content.
    so in the after code, my comment and formula column duplicated with the name of comment2 and formula2. I just delete it because those columns are the one that are not linked in my table. It works fine but I dont know where I have mistakes as I just followed the steps in the video. But if there its ok, I just leave it as is and will just delete it if it will not affect much in the file.

    Also my other concern is that when I put formula in the formula column, it works fine but after I refreshed the external data, the formula vanish and convert it to value which is fine I think but I wanted to have a formula so that it goes well in the table once updated.
    Last edited by dummy777; 10-03-2019 at 07:27 PM.

+ 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. External Data Duplicating When Refreshed
    By c.price in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-08-2019, 05:27 PM
  2. [SOLVED] Live graphing comparing manually entered data with existing data
    By Desert Coyote in forum Excel Charting & Pivots
    Replies: 10
    Last Post: 05-15-2015, 03:05 PM
  3. Matching poor manually entered data
    By pilotpond in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-17-2015, 05:58 PM
  4. Web query refreshed data should get saved
    By purusharth in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-15-2013, 01:44 AM
  5. Not all external data in cells being refreshed
    By errorfree in forum Excel General
    Replies: 1
    Last Post: 05-18-2011, 07:33 AM
  6. [SOLVED] Downloading Refreshed Web Query Data into Adjacent Column
    By SteveC in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-07-2006, 12:35 PM
  7. [SOLVED] Keeping manually entered data
    By Mike Punko in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-06-2005, 02:05 PM

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