Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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
Try
LET vLatestRecord = Peek('Time Stamp', -1, 'Sorted_Record');
(field name with [] removed)
Thank you.