1 Reply Latest reply: Oct 17, 2016 9:37 AM by Landon Wyant RSS

    Load the most recent file into Qlikview based upon its last modified date

    Landon Wyant

      I am attempting to load only the most recent file from a folder into Qlikview based upon the date that it was placed in the folder. Below is my current data. Even with the where statement, it still scans in every file from the folder. Any idea on how to make this work? Thank you!

       

      INVOICE_HEADER_2016_Oct_12_060501.qvd is the file format.


      Invoice_Header:
      LOAD distinct *
      from \\HACQVPROD\QVProd\PRODUCTION\DATA\INVOICES\Daily\Invoice_HDR.qvd(qvd);

      concatenate
      add Load distinct *
      FROM \\HACQVPROD\QVProd\PRODUCTION\DATA\INVOICES\INVOICE_HEADER_2016*.qvd(qvd)
      where Date(FileTime(), 'DD/MM/YYYY') >= Today() -1;


      Invoice_Lines:
      load distinct *
      from \\HACQVPROD\QVProd\PRODUCTION\DATA\INVOICES\Daily\Invoice_LIN.qvd(qvd);

      concatenate
      add Load distinct *
      FROM \\HACQVPROD\QVProd\PRODUCTION\DATA\INVOICE LINES\INVOICE_LINES_2016*.qvd(qvd)
      where Date(FileTime(), 'DD/MM/YYYY') >= Today() -1;