Closed Thread
Results 1 to 12 of 12

Power Query, Problem with combine inconsistent column files in a folder

  1. #1
    Forum Contributor
    Join Date
    12-06-2015
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    513

    Power Query, Problem with combine inconsistent column files in a folder

    Dear all

    I have another problem with Power Query , to combine files (with different column) in a folder.

    See the attached files,

    I have April & May files in One folder, and want to combine them into the April_May file.
    However, error occurs , i try many times but still invain.

    If i have them in one sheet, get data from tables, it is fine

    Any help would appreciated

    Eric
    Attached Files Attached Files

  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,847

    Re: Power Query, Problem with combine inconsistent column files in a folder

    What error?
    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
    12-06-2015
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    513

    Re: Power Query, Problem with combine inconsistent column files in a folder

    Aligw

    How are you, hope this message find you healthy and strong against the COVID19


    have two files

    April file - column are
    Date
    PIC
    Sales

    May file - column are
    Date
    PIC
    Product



    When i get data to combine these two files in a folder, it prompts

    [Expression.Error] The key didn't match any rows in the tables

    An error occurred in the ‘Transform File (3)’ query. Expression.Error: The key didn't match any rows in the table.
    Details:
    Key=
    Item=April
    Kind=Sheet
    Table=[Table]

    How would i fix it

    eric

  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,847

    Re: Power Query, Problem with combine inconsistent column files in a folder

    Are you trying to merge the queries? If so, then if you have no matching data, there will be nothing to merge. Perhaps you should be appending?

  5. #5
    Forum Contributor
    Join Date
    12-06-2015
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    513

    Re: Power Query, Problem with combine inconsistent column files in a folder

    Aligw

    I am trying to append them, but as there is different columns.

    So it prompt Error

    Eric

  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,847

    Re: Power Query, Problem with combine inconsistent column files in a folder

    It should cope. I’m away from my Pc, so can’t look at your files until tomorrow.

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,885

    Re: Power Query, Problem with combine inconsistent column files in a folder

    I did a simple append with the following results. I loaded each table individually and did not have PQ do it from a folder.

    Data Range
    A
    B
    C
    D
    1
    Date
    PIC
    Sales
    Product
    2
    4/12/2020
    Paul
    170
    3
    4/13/2020
    Paul
    186
    4
    4/14/2020
    Bertha
    107
    5
    4/15/2020
    Martha
    187
    6
    4/16/2020
    Peter
    124
    7
    4/17/2020
    Cat
    173
    8
    4/18/2020
    Ericson
    160
    9
    4/19/2020
    Ericson
    172
    10
    4/20/2020
    Sou
    199
    11
    4/21/2020
    Sue
    200
    12
    5/5/2020
    Paul
    Van
    13
    5/6/2020
    Paul
    Van
    14
    5/7/2020
    Cat
    Car
    15
    5/8/2020
    Cat
    Van
    16
    5/9/2020
    Cat
    Truck

    Please Login or Register  to view this content.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  8. #8
    Forum Contributor
    Join Date
    12-06-2015
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    513

    Re: Power Query, Problem with combine inconsistent column files in a folder

    Dear alan

    Thanks,

    when i did it individually with table. it is fine.

    As i want to try to do it from a folder, as user may place their files in a folder each month.

    Is that a way ?

    eric

  9. #9
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,885

    Re: Power Query, Problem with combine inconsistent column files in a folder

    Beyond my knowledge. Hopefully, Ali will have an answer after this weekend.

  10. #10
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Power Query, Problem with combine inconsistent column files in a folder

    Open Power Query/Get and Transform. Click on New Query.
    Open blank query in the editor, launch Advanced Editor and paste in the following code.
    Change folder location in Red

    Please Login or Register  to view this content.
    Last edited by Bo_Ry; 04-12-2020 at 05:51 AM. Reason: Shorten Code

  11. #11
    Registered User
    Join Date
    02-11-2021
    Location
    Argentina
    MS-Off Ver
    2013
    Posts
    1

    Re: Power Query, Problem with combine inconsistent column files in a folder

    Quote Originally Posted by Bo_Ry View Post
    Open Power Query/Get and Transform. Click on New Query.
    Open blank query in the editor, launch Advanced Editor and paste in the following code.
    Change folder location in Red

    Please Login or Register  to view this content.
    Ive found this solution in many places, but what can i do if it doesnt appear Kind "Table" (only Kind "Sheet")?

  12. #12
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,885

    Re: Power Query, Problem with combine inconsistent column files in a folder

    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Power Query / Power pivot : M2M relationships problem
    By almourasel in forum Excel General
    Replies: 6
    Last Post: 03-26-2020, 05:33 PM
  2. Power Query: Combine and Transform from folder
    By LUKE92 in forum Excel General
    Replies: 13
    Last Post: 06-26-2019, 12:34 AM
  3. [SOLVED] I do not have a combine option - Power Query
    By callumlmcgrath in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 05-08-2019, 06:24 AM
  4. [SOLVED] Power Query error when importing files from a folder
    By Howardc1001 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 05-02-2019, 10:28 AM
  5. Replies: 0
    Last Post: 01-14-2019, 12:59 PM
  6. [SOLVED] Excel Power Query - Only New Files Using 'From Folder'
    By rabbit_post in forum Excel General
    Replies: 4
    Last Post: 11-12-2018, 06:07 AM
  7. Inconsistent behavior when performing SQL query on CSV files with VBA UDFs
    By insomniac_ut in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-30-2016, 05:00 AM

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