Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Still new to Qlikview.
I am trying to do some incremental download using QVD and adding more files and store it to a n updated QVD file.
The Data contains time stamp. So far I have downloaded some QVD files. Now, I'd like to add some csv files with criteria where the latest time stamp is greater than the latest time stamp in QVD file. What I did was
Incremental_CDR:
LOAD Distinct
[Time Stamp], B,C,D,E,F,
FROM [..\QVD\Filename.qvd] (qvd);
//Last_Record:
LOAD Max (timestamp([Time Stamp])) as Latest_Time_Stamp
Resident Incremental_CDR;
LET $(vLast_Record)= Peek('[Latest_timestamp]', 0, 'Last_Record)');
trace >>> $(vLast_Record);
//Load new Records
concatenate
LOAD Distinct
FROM
$(vSourceData)Filename_*.csv
(txt, codepage is 1252, embedded labels, delimiter is ',', msq)
Where Timestamp([Time Stamp]) > $(vLast_Record);
but it failing with error as follows:
Field not found - <>>
concatenate
LOAD Distinct ...... and rest of the message
When I changed the $(vLast_Record) to a date(e.g. '09/05/2016') it works, but I want to to make it more precise and need to rely on the latest time stamp in last record so that I can append the qvd data and next time do another incremental load will simply use the latest time stamp in the latest qvd file or last record in another source.
Any clue or help?
This statement is incorrect:
LET $(vLast_Record)= Peek('[Latest_timestamp]', 0, 'Last_Record)');
It should be:
LET vLast_Record= Peek('[Latest_timestamp]', 0, 'Last_Record)');
no $() on the variable name.
-Rob
LOAD Distinct
FROM
$(vSourceData)Filename_*.csv
(txt, codepage is 1252, embedded labels, delimiter is ',', msq)
Where Timestamp([Time Stamp]) > $(vLast_Record);
You haven't specified any fields to retrieve from the csv file. Perhaps LOAD Distinct * ....etc... does what you want.
Hi,
Actually I did, just forgot to put in the example above. It should be like this
LOAD Distinct
[Time Stamp], B,C,D,E,F,
FROM
$(vSourceData)Filename_*.csv
(txt, codepage is 1252, embedded labels, delimiter is ',', msq)
Where Timestamp([Time Stamp]) > $(vLast_Record);
It keeps showing the same error
Remove the comma after the F.
Hi, Yes I did. Actually field names are just the examples. No comma after
real filed names.
Also, no value after trace command - trace >>> $(vLast_Update_Record);
On Sat, May 14, 2016 at 7:14 AM, Gysbert Wassenaar <qcwebmaster@qlikview.com
//Last_Record:
LOAD Max (timestamp([Time Stamp])) as Latest_Time_Stamp
Resident Incremental_CDR;
LET $(vLast_Record)= Peek('[Latest_timestamp]', 0, 'Last_Record)');
Remove the square brackets: Peek('Latest_timestamp', 0, 'Last_Record)');
Remove the ) character after Last_Record: Peek('Latest_timestamp', 0, 'Last_Record');
Use the correct field name: Peek('Latest_Time_Stamp', 0, 'Last_Record');
You might also want to make sure you get a numeric value back: num(Peek('Latest_Time_Stamp', 0, 'Last_Record'));
I fixed all syntax but still got the same message.
trace >>> $(vLast_Record); also did not return any value. Is there anything missing?
If I changed the condition to certain date it works but I want to make it more autonomous so that I will simply append the data everything I run the script instead of manually change the date or even time.
Any suggestion or help from the experts in this community?
Thanks in advance
Post an example qlikview document that demonstrates the problem along with two source files that contain at least the timestamp field.
Hi, Please find attached the sample