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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Update based on Time Stamp in incremental load

I am very new to Qlikview and would like to do incremental load based on the latest time stamp in QVD file.

I stored the initial data on QVD file that has a few columns, where column A is Time Stamp.  I sorted the time stamp in the QVD just to ensure all time stamps are in order with below script.

Initial_Data:

LOAD [Time Stamp], B,C,D,E,F

             

FROM

$(vQVDSave)Initial_data.qvd

(qvd);

Sorted_Record:

LOAD *

Resident Initial_Data

order by [Time Stamp];

LET vLatestRecord = Peek('[Time Stamp]', -1, 'Sorted_Record');

Drop table Initial_Data;

//Load new Records

Latest_Data:

LOAD [Time Stamp], B,C,D,E,F

FROM $(vDataSource) filename.csv

(txt, codepage is 1252, embedded labels, delimiter is ',', msq)

Where [Time Stamp] > $(vLatestRecord);

It did not work properly when I reloaded it and keep showing error message

Field not found - <>>

Latest_Data:

LOAD Filed Names....

FROM

where [Time Stamp] >

Any clue?  Appreciate any suggestion from the experts in this forum to fix this.

3 Replies
Anonymous
Not applicable
Author

Hi Ahmad,

You're getting that error  message, because your variable vLatestRecord is empty.  Check the line


LET vLatestRecord = Peek('[Time Stamp]', -1, 'Sorted_Record');


To make sure that Peek is returning a value.


Regards,

-- Karla

swuehl
MVP
MVP

Try

LET vLatestRecord = Peek('Time Stamp', -1, 'Sorted_Record');


(field name with [] removed)

Anonymous
Not applicable
Author

Thank you.