Locked lesson.
About this lesson
Before you unleash this magic skill, there is a bit of prep-work that should be done to future-proof your solution and make it more portable. In this lesson we will explore how to do this.
Exercise files
Download this lesson’s related exercise files. You can download source data files for the course from the resources section of your Lessons page.
Append all files in a folder - Preparation.xlsx19.7 KB Append all files in a folder - Preparation - Completed.xlsx
21.2 KB
Quick reference
Append All Files in a Folder - Preparation
Preparing to append all files in a folder into a single query.
When to use
Use to properly prepare for combining all files in a folder by following best practices.
Instructions
Getting Started
- Create a new query --> From File --> From Folder --> browse for the folder that holds the files
- When you arrive at the preview pane click Edit
Building the FilesList query
- Right click the Extension column --> Transform --> Lowercase
- Click the filter icon at the top of the Extension column --> Text Filters
- Set a text filter “Equal to” the file extension you wish to use
- NOTE: Do not forget the period and make sure you type it in lower case!
- Rename the query to FilesList
- Finalize the query by going to Home --> Close & Load To… --> Only Create Connection
Hints & tips
- If there is a chance that someone will edit the files in the target folder while you are refreshing your solution, you should add a filter to the Name column for “Does Not Begin with” ~ (the tilde character) to ignore temp files
- If you want to target a subfolder, filter the Folder Path column to get to the correct subfolder
- When targeting Excel files, you may want to filter to extensions that “Begin with” .xls as this will pick up all valid Excel files
Lesson notes are only available for subscribers.