SCD2 Monkey
Coming Soon! Sorry, but this article isn’t quite ready yet. We promise that we’re working on it! In the mean time – until we get
One of our favourite tricks is to create a “From Folder” solution which avoids hard-coding a file path, instead pulling it dynamically via our fnGetParameter setup. The issue is that this creates a link to either a local or SharePoint / OneDrive for Business folder. However, this causes problems when you open the file in a state that returns the alternate path, as Power Query user different connectors.
The SmartFolder Monkey solves all of this for you. It creates an easy to use interface to inject the fnGetParameter and fnSmartFolder queries, links them together, and gets you up and running fast with a solution that avoids triggering the formula firewall error.
Overall, this Monkey does a few things for you. It will:
All you then need to do is set the Privacy for the query and provided any SharePoint credentials in order to access the solution. Once done, you’ll never again be prompted with errors due to a file path change!
The SmartFolder Monkey is intended to get you up and running with a dynamic From Folder solution quickly. To do so, our recommended steps are:
If Excel recognizes your file as stored in a SharePoint or OneDrive for Business folder, you will then need to do the following:
The next component to know is how to set up your solution for success if you would like to use Power Query’s combine or merging functionalities. We highly recommend that you do not perform these operations directly in the FilesList query, but rather you take the following actions:
The SmartFolder works by returning the path to where the current workbook is saved via Excel’s CELL() function. If you are planning to combine files from multiple folders, we recommend setting up a folder structure that lives within the folder where your workbook is saved. This offers the following benefits:
Monkey Tools defaults are built to mimic the default “From Folder” behaviour provided by Microsoft. What this means is that our monkeys provide you with a query that shows all files in the target folder, as well as subfolders.
For some solutions this can be very useful as – looking at the Financials image above, you would be able to easily filter to all folders which contain the term “Statements” and aggregate every file for all years. The drawback of this setup, however, is that Power Query needs to filter out all irrelevant files first. Depending on how many tens, hundreds or thousands of files you have in the subfolder hierarchy, this could take a long time.
For this reason, SmartFolder Monkey makes it easy to choose a different connector which returns a list of only the files in the target folder.
Let’s compare what the two options here look like. To begin with, consider the following output, which is the result of targeting a specific subfolder with the “Show files in subfolders” option checked:
Notice that we have four files in the root of the folder, two in a subfolder called CSVs, and hundreds in the Production Forecast folder and subfolders. If we just want the two csv files, a filter to the CSVs folder will work, but Power Query still needs to enumerate through the hundreds of files in the other folders to compare if their path is equal to the CSV folder. Ouch!
Now let’s see what a specific subfolder with the “Show files in subfolders” option un-checked looks like:
We still have our four files in the target folder, but instead of all files in all subfolders, we now show two tables representing the subfolders of the target folder. The fact that there are hundreds of files in those subfolders is irrelevant to Power Query’s performance however, as it only needs to enumerate the six items living in this folder. Should you want the CSVs, just click the Table keyword to drill into it and see those files.
Prefer to watch a live demonstration? Check out the recording of Ken’s presentation to the KSA Excel user group when it was first introduced as a new Monkey Tools feature! (The Query Monkeys menu was a little shorter back then!)
Coming Soon! Sorry, but this article isn’t quite ready yet. We promise that we’re working on it! In the mean time – until we get
Coming Soon! Sorry, but this article isn’t quite ready yet. We promise that we’re working on it! In the mean time – until we get
Article Overview Many modelers like to store their measures on a single “Measures” table in the data model. If you’re one of them, you may
Coming Soon! Sorry, but this article isn’t quite ready yet. We promise that we’re working on it! In the mean time – until we get
Article Overview One of the things that we do at Monkey Tools is help people with questions in forums. When someone provides us with an