Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I'm having 4 rows of data like below
Item | country | Modified date | FLAG |
1234 | India | 27-07-2020 | 0 |
3456 | Canada | 28-07-2020 | 0 |
5676 | USA | 30-07-2020 | 0 |
7890 | Canada | 01-08-2020 | 0 |
on first reload the above data will be saved in qvd. now the update will be like addition of 2 rows within that one is a new record another one is as same as old record but only modified date will get change(last row)
Item | country | Modified date | flag |
1234 | India | 27-07-2020 | 0 |
3456 | Canada | 28-07-2020 | 0 |
5676 | USA | 30-07-2020 | 0 |
7890 | Canada | 01-08-2020 | 0 |
9876 | Sweden | 01-09-2020 | 0 |
1234 | India | 28-07-2020 | 1 |
Now in the last row the record is same , only change is modified date, in this case if we do concatenate it will add all the rows and it will save it in qvd, but I want to delete the existing record and add the new record and save it in qvd. how can I achieve this? I need resultant value to be like below in QVD
Item | country | Modified date | flag |
3456 | Canada | 28-07-2020 | 0 |
5676 | USA | 30-07-2020 | 0 |
7890 | Canada | 01-08-2020 | 0 |
9876 | Sweden | 01-09-2020 | 0 |
1234 | India | 28-07-2020 | 1 |
Thanks
Hi there.
You should use incremental load: Incremental Load Qlik Help
Regards
Could you please send the code or example..I have tried incremental load but in that am able to get the new records but not able the replace the old one.
Qli Help has one simple and applicable example:
Let ThisExecTime = Now( );
QV_Table:
SQL SELECT PrimaryKey, X, Y FROM DB_TABLE
WHERE ModificationTime >= #$(LastExecTime)#
AND ModificationTime < #$(ThisExecTime)#;
Concatenate LOAD PrimaryKey, X, Y FROM File.QVD
WHERE NOT EXISTS(PrimaryKey);
Inner Join SQL SELECT PrimaryKey FROM DB_TABLE;
If ScriptErrorCount = 0 then
STORE QV_Table INTO File.QVD;
Let LastExecTime = ThisExecTime;
End If