Hi All,
Hopefully you can help.
This file contains 3 sheets.
PowerQuery - This contains just a link to the Source sheet
Againg Table - Just showing you how we group the data together.
Source: This is just the source data that will be linked to an extract in a folder.
What we want to do is use PowerQuery to bring data that is in a folder which I have the skills to do LOL :). A sample of that is in the Source sheet between A:H. Column I J and K is just what we use today without PowerQuery to calculate our buckets. Esentially we will bring the file in through PowerQuery and want to add some logic to add these aging buckets based off the logic. Today Date which can be a manual entry - Contact Date.
Can someone please help me creating the logic to create these buckets so that when we bring in the new file it automatically creates these bucket namethe Age of Encounters. So it would be the days outstanding and then the actual bucket. As seen in Source sheet Column J and K.
48 Hrs Open |
4-5 Days |
6-13 Days |
14-27 Days |
28-55 Days |
56-111 Days |
112-223 Days |
224-364 Days |
365+ Days |
Thank you kindly for reading.
Hi Steven,
No file is attached. You have to click the Upload button to load the file.
Read This First | Forum Rules and Guides | Excel Forum • My Online Training Hub
Regards
Phil
My apologies. Let me try again.
Excel Version:
Microsoft® Excel® for Microsoft 365 MSO (Version 2202 Build 16.0.14931.20704) 64-bit
Hi Steven!
Is this what you're looking for? 🙂
As a variant, please see the attached file. Same end result as Jessica. Different method. I thought is was easier to prepare the bucket list in Excel and use the Append option in PQ, rather than multiple Merge steps.
Thank you so much for taking the time out of your day to help me.
Riny, I applied your solution but I just realized that I will have problems in the future, not with the solution provided, but with my process.
The issue I belive I will run into is keeping the aging date static. Right now my logic is to get (todays date - contact date). If I do this from week to week the date will change and the aging buckets will move for all of the files. I do not want that, I only want the aging buckets to be frozen in time Is there a way to replace my logic to grab File Create Date instead of Todays Date? I think If I implement the file create date I will be able to accurately calculate my age buckets and will be frozen in time. I just dont know how to dynamically add the file create date as I keep on adding these weekly files.
What I need to do is have 2 queries, the first one would be to grab just the current week file and the second query will start to aggregate all of the weekly files toghether, with the static logic, so we can perform trending.
I hope I am making sense.
Thank you for reading.
If you connect to Files From a Folder, you will see an overview of all files in the folder with the following columns (screenshot below):
Note the "Date created" column. Remove all columns except Content and Date created, and press the arrowed button in the Content column and select the table you want to import. That should create a bunch of Applied steps, one of which is labeled "Invoke Custom Function". Remove all of the next steps. Now you have a table with three columns (Contents, Date Created and Transform File). Get rid of the Content column and expand the Transform File column.
The resulting table will look like this. Note that you have the creation data in the first column which you can use, in stead of today's date, to calculate the ageing (Date created minus Contact date).
Hi Riny, May I please ask one more question.
I would like to create a count through the following logic. If Age of Account is greater than 5 days then add a column with a numerical value of 1. If its less than or equal to 5 then leave blank. What I would like to do is identify how many accounts are over 5 days old.
Thank you gain.
You can add a custom column with the following code: