Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
im trying to start an incremental load based in timestamps.
BUT the creation of a variable with which i want to limit the load does not work.
let vMAXTIMEms= 'peek(time_mill,-1,data_table) ;
seems to be completely ignored by the qlikview script (no syntax error on that line).
at the line where the variable should be used, i get an error. what is wrong ? Maybe some problems with peek and the variable ?
Any ideas ?
The table looks like this
data_table:
LOAD
source_ID,
source_TYPE,
time_RES,
time,
time_mill,
UNIT,
VALUE
FROM ./QV_VALUES.qvd
WHERE time_RES = 'DAY'
AND source_TYPE = 'A'
;
The plan is to follow these steps in the script
1. load the old data from qvd to get the date of the last entry. To speed this up, only the timestamp field is loaded
data_table:
LOAD
time_mill
FROM ./QV_VALUES.qvd
WHERE time_RES = 'DAY'
AND source_TYPE = 'A'
;
2. write the max(timestamp) in a Variable vMAX_mill
let vMAXTIMEms= 'peek(time_mill,-1,data_table) ;
3. use $(vMAXTIMEms)>=time_mill
in the incremental part of the loadscript
Do I see an apostrophe in front of peek?
Agreed - there should be no apostrophe there, but there should be quotes here:
Let vMAXTIMEms = Num(peek('time_mill',-1,'data_table'));
This assumes that the qvd load is sorted by time_mill. i would also ensure that it is a number with Num(). Otherwise you should do this:
temp:
LOAD max(time_mill) As maxTime
From .... (qvd); // or resident....
Let vMAXTIMEms = Num(peek('maxTime'));
DROP Table temp;