Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Support Case Portal has moved to Qlik Community! Read the FAQs to start exploring Support resources.
cancel
Showing results for 
Search instead for 
Did you mean: 
andreip21
Contributor III
Contributor III

load last qvd in folder

Hello all,

How do i load (Qlik script) all columns from the the latest modified ,qvd from a specific folder?

I saw multiple simmilar open topics on Community, but without correct anserws.

Regards,

Andrei

1 Solution

Accepted Solutions
bramkn
Partner
Partner

FOR Each File in FileList('<path>')

AllQVDs:

    LOAD

             '$(File)' AS QVD,

             FileTime('$(File)') AS QVDModifiedDate

    AutoGenerate(1);

Next File

NewestQVD:

FIRST 1 LOAD

     QVD,

     QVDModifiedDate

RESIDENT AllQVDs

ORDER BY QVDModifiedDate DESC;

DROP TABLE AllQVDs;

This will result in a table with 1 record containing the newest QVD

Use Peek or Lookup to get the value of the QVD and load from this path.

hope this was clear enough

View solution in original post

13 Replies
vinieme12
Champion II
Champion II

Load first time or Reload ?

PrashantSangle

can you elaborate little bit more??

what is your folder structure??

in which way you are storing file?

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
sujan24s
Contributor III
Contributor III

Load the latest file of a folder

can You check this it may be useful

vardhancse
Specialist III
Specialist III

Hi In general if we will get new files always and we need to load latest file.

We need to write script to move existing file to Archive file and then place new fiel in the current load folder:

Lets assume here are the files & folders available in load folder:

Archive

sample_20180326.xlsx

so now if we assume we have new file "sample_20180327'.xlsx, in general we will write a script to move existing 'sample_20180326.xlsx' to archive folder and then place the new file 'sample_20180327.xlsx' into load folder

In general we will ask stake holders to do the work manually or we will automate using some script

andreip21
Contributor III
Contributor III
Author

load first time.

this is how my folder looks.

I want to load only the last modified file (18_03_26-1600)

folder.JPG

andreip21
Contributor III
Contributor III
Author

it's a folder from my local sharepoint. i want to load some columns from the last modified .qvd file.

andreip21
Contributor III
Contributor III
Author

each day 2 new .qvd files are appearing in this folder. when i load data, i want to load the last modified .qvd.

bramkn
Partner
Partner

Use a filelist loop to get all files in the folder and then read the modified date to determine which one you want with load first and order by modified date. This approach does not work if the files are never archived. As the reload will take longer everyday (retrieving the filelist)

andreip21
Contributor III
Contributor III
Author

yes, great theory, but i'm using qlik only for 2 months and i don't know all functions