Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Loop incremental load script.

Hello,

I like to run an incremental load process that does the following:

I’m loading a data on a daily basis and Its yesterday data.

The data is stored in QVD file

At the end of each load, I check the last date that was loaded.

Now I need this to be done in loop until the last day that is loaded is today.

For example:

My max date in the QVD is  30/06/2013,

So I like the load process to keep running until the I got yesterday date.

All the file are named as:

  1. Log.29/06/2013
  2. Log.30/06/2013
  3. Log.01/07/2013

And the max date I’m taking from the QVD is a variable that I use to load the next file.

------------------------------------------------------------------------------------------------------------------------

This is the code that I like to put in a loop until I got yesterday date in the QVD

Incremental:

NoConcatenate

LOAD 

     @1 as A,

     @2 as B


FROM

$(vSourceData)Log.$(vNextFile)

(txt, codepage is 1255, no labels, delimiter is '|', msq);

 

Concatenate

LOAD

     A

     B

    

FROM

$(vSaveQVD)Data.qvd(qvd);

STORE Incremental into $(vSaveQVD)Data.qvd(qvd);

next.load:

load 

left(maxstring(date),10) as next.date

Resident Incremental;

let vNextFile= Peek('next.date',-1,'load.date');

drop table next.load;

Thanks.

0 Replies