Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
GOKULAKANNAN
Creator
Creator

Replace Data into Qvd

Hi All,

 

I'm having 4 rows of data like below

ItemcountryModified dateFLAG
1234India27-07-20200
3456Canada28-07-20200
5676USA30-07-20200
7890Canada01-08-20200

 

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)

 

ItemcountryModified dateflag
1234India27-07-20200
3456Canada28-07-20200
5676USA30-07-20200
7890Canada01-08-20200
9876Sweden01-09-20200
1234India28-07-20201

 

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

 

ItemcountryModified dateflag
3456Canada28-07-20200
5676USA30-07-20200
7890Canada01-08-20200
9876Sweden01-09-20200
1234India28-07-20201

 

Thanks

3 Replies
Thiago_Justen_

Hi there.

You should use incremental load: Incremental Load Qlik Help 

 

Regards 

 

Thiago Justen Teixeira Gonçalves
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago
GOKULAKANNAN
Creator
Creator
Author

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.

Thiago_Justen_

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

Thiago Justen Teixeira Gonçalves
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago