Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Update QVD Data with New One

Hi I have a question about updating qvd data.

First, i've load the data from SourceA,

The data is like this:

Name      LastName     Qty

A               AB               5

I Store that table into Data.QVD

Another week i have another data Source lets say SourceB

The data is like this:

Name     LastName     Qty

A               AB            10

i want to update Data.QVD , so the Qty data will be update from 5 to 10

Is it possible to make it ?

I have try using concatenate, but it keep both data (data with qty 5 and data with qty10)

The result i expect is Data.QVD will have data like this:

Name     LastName     Qty

A               AB            10

Thanks in advance

1 Solution

Accepted Solutions
Peter_Cammaert
Partner - Champion III
Partner - Champion III

You'll need some sort of primary key (an id that uniquely identifies each row) and the exists() function to accomplish this. Imagine that Name & LastName can be considered your primary key, then you can go ahead as follows:

NewData: // Load new & updated records

LOAD Name, LastName, Qty, Name & '|' & LastName AS PK

FROM SourceB (options);

CONCATENATE // Add historical records that haven't been updated

LOAD Name, LastName, Qty

FROM SourceA (options)

WHERE Not Exists(PK, Name & '|' & LastName);

DROP Field PK;

This is more or less the basic technique to perform a so-called Incremental Load;

Best,

Peter

View solution in original post

6 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

You'll need some sort of primary key (an id that uniquely identifies each row) and the exists() function to accomplish this. Imagine that Name & LastName can be considered your primary key, then you can go ahead as follows:

NewData: // Load new & updated records

LOAD Name, LastName, Qty, Name & '|' & LastName AS PK

FROM SourceB (options);

CONCATENATE // Add historical records that haven't been updated

LOAD Name, LastName, Qty

FROM SourceA (options)

WHERE Not Exists(PK, Name & '|' & LastName);

DROP Field PK;

This is more or less the basic technique to perform a so-called Incremental Load;

Best,

Peter

gautik92
Specialist III
Specialist III

use incremental load

senpradip007
Specialist III
Specialist III

Data:

load * inline [

Name,      LastName,     Qty

A,               AB,               5

];

Store Data into Data.qvd(qvd);

Data:

NoConcatenate

load * inline [

Name,      LastName,     Qty

A,               AB,               10

];

Store Data into Data.qvd(qvd);

Try like this.

sunny_talwar

I think you need to look at incremental load which allows for deleting and updating records. May be check these links out:

HTH

Best,

Sunny

Anonymous
Not applicable
Author

Hi all,

Thanks for your response.

It solve my problem perfectly.

Thanks in advance

Anonymous
Not applicable
Author

Hi Peter,

Your idea is perfect !

Thanks in advance