Forum

Copy current data t...
 
Notifications
Clear all

Copy current data to master set instead of Append

7 Posts
2 Users
0 Reactions
80 Views
(@bluesky63)
Posts: 162
Estimable Member
Topic starter
 

Hi Catalin / Mynda

Currently I got master table,  each month we need to add the latest data in the master table (See attached AppendTables_tobePermanent.xlsx consist of Oct19 + Nov19)

As the Nov19 is always reference to MasterTable (Started from Oct 19),  and when times go by,  there will be a lot of queries,  Dec19, Jan20, Feb20......

i was thinking whether there is a way to break the reference whenever a current month data append to the master,   so I can only maintain a current query that point to a file call current.xlsx (Source),    I just need to put in the data that need to copy/append to the master.

 
Posted : 13/12/2019 2:22 am
(@catalinb)
Posts: 1937
Member Admin
 

It's not right Chris.

Use a query from File> From Folder, not a query from excel file for each file in a folder.

whenever a new file is added to that folder, data will be extracted, you will always have a single query that you don't need to update.

 
Posted : 13/12/2019 2:46 am
(@bluesky63)
Posts: 162
Estimable Member
Topic starter
 

Hi Catalin,

ooh,  have not tried from folder yet.  so I put Oct 19,  Nov 19 inside the folder,   Append them and whenever there is a new file Dec 19,  it will automatically append to the single query ?

 
Posted : 13/12/2019 3:48 am
(@bluesky63)
Posts: 162
Estimable Member
Topic starter
 

Hi Catalin,

I was not familiar with query from File> From Folder

manage to put Oct 19, Nov 19 to a folder

In the query

ContentNameExtensionDate accessedDate modifiedDate createdAttributesFolder Path

Binary.FromText(...) Nov19.xlsx .xlsx 12/12/2019 2:03:15 PM 12/12/2019 2:03:15 PM 12/12/2019 2:02:19 PM [Record] C:UsersUserDocumentsPowerBI & PowerQueryMyonlineTrainingListing
Binary.FromText(...) Oct19.xlsx .xlsx 12/12/2019 2:08:51 PM 12/12/2019 2:08:51 PM 12/12/2019 2:00:39 PM [Record] C:UsersUserDocumentsPowerBI & PowerQueryMyonlineTrainingListing

how to proceed from here ?

 
Posted : 13/12/2019 4:03 am
(@bluesky63)
Posts: 162
Estimable Member
Topic starter
 

Hi Catalin,

I did combine with edit

Encounter error for the second excel Oct 19

An error occurred in the ‘Transform Binary from Listing’ query. Expression.Error: The key didn't match any rows in the table.
Details:
Key=Record
Table=Table

 
Posted : 13/12/2019 4:27 am
(@catalinb)
Posts: 1937
Member Admin
 

after you get the list of files in that folder, add a new column with the formula:

=Excel.Workbook([Content])

Then you will expand this new column.

You have a tutorial here: https://www.myonlinetraininghub.com/power-query-get-files-from-a-folder

 
Posted : 13/12/2019 4:51 am
(@bluesky63)
Posts: 162
Estimable Member
Topic starter
 

Hi Catalin,

got it thank you very much

 
Posted : 15/12/2019 3:13 am
Share: