Hi All,
I'm new here and hopefully I could get some help from here.
I know how to get Excel files from a folder and create query for merging two files. Now, my question is how do I get the newest file that I save next month?
For example, I have a report I save in the folder every month and also a file named "Reason" save in the sub folder. I have created a connection on the file name "Report". And everything works perfectly. However, when next month come, I will have new file in the "Report" folder and the "Reason" folder, all format is same. So, how do I create a query that will automatically get the newest file that we need to do the work?
I hope I didn't confuse you all. Thanks for your help.
Hi MissMia,
Welcome to our forum.
First of all, my understanding is that 'Report' is the source data file and 'Reason' is the file containing the query.
It's not clear if you want to add the data from the new 'Report' file to the 'Reason' file each month, or keep the previous month's 'Reason' file as is, and start a new 'Reason' file for the current month that gets the current 'report' data?
Thanks,
Mynda
Hi Mynda,
Thanks for your reply. No, the Report is the file containing the query. Every month, I receive a file from manager about the late shipments. This file is on excel and it's already a table. What I have is the reason code that I keep track every month. So, lets say in January, I received the file from my manager and asked me to provide reason code to the shipments that were late. The report has sales order number, delivery number and other information. The reason file that I keep has sales order, delivery number and the reason code. I did a kind of like Vlookup thing on the report file which is if the sales order and delivery number matched, then applied the reason code. So, everything looks perfect and I had no problem creating the query. But, next month, I will have to do the same thing for February. Does it mean I have to re create the query again? The February report and reason file will be in different name but same format. And, after I done the report, I have to send it back to the manager. I thought there was an easy way to do it.
Thanks again.
Thanks for clarifying, but I have further questions to help with my understanding. When you get the February file do you discard the reason codes from the January file and replace them with the February file or are these in addition to the January reasons?
If you were to use VLOOKUP for this task, would you add the February reasons to the bottom of the January reasons table or would you re-enter your VLOOKUP formulas so they pointed to the new February data only?
Mynda
Mynda,
I was going to attach some files here but I don't know how. Anyway, this is what I did in January. I have a file for the reason code in Excel - 3 columns: Sales order number, delivery number and reason code. I save it as January Reason. When I received the report in excel file, lets call it "January Report" that needs reason code, I open that file (it's already in a table format), go to data > load and close to > create connection. Then, I go to Merge these 2 tables - merged "Reason" table with "Report" table. Then, I matched the columns with Sales order and delivery, then apply the reason code to the "January Report". So, i built a query for this. The report looks fine. I sent it to the manager.
Next month, I will receive a "February Report" and I will have a "February Reason" Save in the same location. What I want to know is do I need to rebuild the query like I did previous month? Or, is there a way I can just click the refresh button so the two tables will be merged?
Thanks again Mynda.
When you are writing your reply, there's a button below the box you are typing in marked 'Attachments'. Click on that and then on 'Add Files' and select your file(s) for upload.
Then click on the orange 'Start Upload' button.
Finally click on 'Submit Reply'
Regards
Phil
If in February you have two new files that don't contain any queries, then you can copy the query from the January file (select it in the query pane > CTRL+C) and paste it into the February file, then edit the query in February's file so it points to the February data.
Mynda
Thank you Mynda!
Philip,
OMG...how come I didn't see that button?
Thank you!
🙂