Forum Discussion

klarrick's avatar
klarrick
New Member
3 years ago
Solved

Week Over Week comparison using daily files in the same folder

I'm building a query that accesses a folder where daily files are saved.  I need to compare the most recent file to the file from the same day last week (the 6th file from the top of folder).  The ru...
  • ImkeF's avatar
    3 years ago

    Hi klarrick ,
    if it is always the 6th file, you could add an index column once you have imported from folder.
    If it is 0-based, choose values 0 and 5 from that index column. That leaves you with the relevant files.
    Expand out the file content, check column "Report Run Date" and delete it. Then check the Index-column and pivot on it with column "Actual Total $" as amount-column.
    This will return 2 new columns: 0 and 5: Check them and add column that subtracts one from the other.
    If you want to keep the a reference day in your table, add it as an additional column after you have created your index with the following formula: if [Index] = 0 then [Report Run Date] else null 
    Then fill down on that column.