Forum Discussion
spehe
Nov 03, 2021Copper Contributor
Manually choose file to query
I have an Excel workbook that queries another workbook for its content, and then do a bunch of other things. Using the 'New Query' in Excel, makes me point to a specific file to query, but in my case...
Riny_van_Eekelen
Nov 04, 2021Platinum Contributor
spehe In case you always want to query the most recent file, store all files in a dedicated folder as they come in. Get data From File, From Folder, and navigate to the designated folder, Open and choose Transform Data. Now you will see the content of the folder. In the "Date created" column filter for Date "Is Latest". Remove all columns except the first one called "Content" and press the two-arrow icon beside the column name. Do your transformations. Close and load. That's it.
When a new file comes in, just refresh the query. No need to change file name as the query will always use the most recent file in the folder.