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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

About incremental loading

Hi All,

I am using the following script to do the incremental loading.

QV_Table:

SQL SELECT PrimaryKey, X, getdate() as InsertDate FROM DB_TABLE

WHERE ModificationTime >= #$(LastExecTime)#;

Concatenate LOAD PrimaryKey, X, InsertDate FROM File.QVD

WHERE NOT Exists(PrimaryKey);

STORE QV_Table INTO File.QVD;

You can see that, The InsertDate will be always changing when the row is updated.

What I want is keep the InsertDate static even though other columns are updated, that mean the InsertDate is the initial insert date.

How to finish it?

1 Reply
Not applicable
Author

Hi Izq_isaac,

As far as I understand your script, it already works per your requirement.

- in QV)_table you're only loading the new records, where currentDate (getdate()) is the value for insertDate

- in your concattenate-Load statement, you're loading the previous loaded records (with the insertDate they got at the moment they were loaded), and only the concttenated records will have the insertDate of getDate()/currentDatetime

Perhaps I'm missing something?

You also write about "insertDate will be changing when the row is updated": in this script there is no factility for "record-updates": it just inserts new ones (and checks on the primary key). Is this the thing you need to change?