Load latest Excel file to Qlikview

    Hi All,

     

     

    The below script helps you in loading the latest data from the given folder based on the filename.  The below script helps you in loading the latest year automatically

     

    Example: Filename formats

    Budget 2014.xlsx

    Budget 2015.xlsx

     

    LET vFilePath = 'C:\Qlikview\Data';
    
    FOR EACH file in FileList('$(vFilePath)\*.xlsx');   // Loops each excel file in the given Folder
    LET vFileYear =  Left(Right(file, 9), 4);                    // Gets the year portion from the filename
    LET vMaxYear = Rangemax(vFileYear, vMaxYear);  // Gets the max year for every iteration
    NEXT
    
    Data:
    LOAD *
    FROM
    [$(vFilePath )\Budget $(vMaxYear).xlsx]      // Load Max year data
    (ooxml, embedded labels, table is [Sheet1]);
    

     

    Based on your requirement you can slightly change the script and use it in your Dashboard.

     

    Hope this helps you.

     

     

    Regards,

    Jagan.