Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

What's the easiest way to load the most recent data in your QV?

hi,

I have a program that shows an overview of data but every month i get a new datafile with the most recent data in it. Is it possible to load the newest file without always having to manualy choose the sourcefile?
example: file1: 200905.xls; file2: 201003.xls; file3: 201102.xls.

load *
from MOSTRECENT.xls

Is there a way to check the date in the filename and load the most recent? or do i have to add a field date in the xlsfile?

1 Reply
Not applicable
Author

Hi Reignfire,

This is what Incremental load is about.

See the below script to get an idea. By this you are able to Update and Insert.


Let ThisExecTime = Now();

QV_Table:
SQL SELECT PrimaryKey, X, Y FROM DB_TABLE
WHERE ModificationTime >= #$(LastExecTime)#
AND ModificationTime < #$(ThisExecTime)#;

Concatenate LOAD PrimaryKey, X, Y FROM File.QVD
WHERE NOT EXISTS(PrimaryKey);

Inner Join SQL SELECT PrimaryKey FROM DB_TABLE;

If ScriptErrorCount = 0 then
STORE QV_Table INTO File.QVD;

Let LastExecTime = ThisExecTime;

End If


Hope it helps

sravan