Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

.QVD Update - Can I add/update an existing .QVD with having to create a new .QVD?

Greetings All:

  1. I have a previously created .QVD file being loaded;

  2. I have a new set of data being loaded from a table file with the same data fields as in the aforementioned .QVD file;
  3. I want to add the new data from step 2 to the .QVD from step 1;
  4. The only way I seem able to do this is to create an entirely new .QVD file via the STORE procedure;
  5. My question is: is there a way to actually "update" the incoming .QVD with the new data without having to create a new .QVD output file?

I only have the QV Personal DeskTop so I cannot read any .QVW samples that you good people might provide.

I have attached the script using very simple data to illustrate my question/problem. You will see that I have had to create a new .QVD to contain the previous .QVD data along with the new data being loaded.

Thanks to everyone

Dave

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

There is no facility to update in place or append to an existing QVD. The QVD must be rewritten in it's entirety with a single STORE statement, The script you posted is the only way to "update" a QVD:

1. Collect all rows, including any existing QVD rows, into a single resident table.

2. STORE the resident table to QVD file overwriting any existing QVD file.

-Rob

View solution in original post

4 Replies
Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

The answer is Yes.

The question i have is is this complete new set of data or incremental?

//Ok so if it's complete new set of data do this

NewOrders:

LOAD OrderID,

     OrderDesc,

     OrderQty

FROM

(txt, codepage is 1252, embedded labels, delimiter is ',', msq);

Concatenate(NewOrders)

LOAD OrderID,

     OrderDesc,

     OrderQty

FROM

(qvd);

STORE NewOrders INTO C:/QVProgramTestDevelopment/OrdersInQVDFormatTwo.qvd;


If it's incremental load, there is caution here. The incoming data would have been modify in one way or the other, i.e. DELETE, INSERT, or modified. In this

//If the data have been modified you need to store last reload timestamp and current timestamp in a variable then use something like this. Here you can also use WHERE NOT EXISTS(OrderID) in place of the date time used

NewOrders:
LOAD OrderID,
OrderDesc,
OrderQty
FROM

(
txt, codepage is 1252, embedded labels, delimiter is ',', msq);


Concatenate(NewOrders)

LOAD OrderID,
OrderDesc,
OrderQty
FROM

(qvd)

Where OrderDate >= '$(vLastExtractionDate)'

and OrderDate < '$(vCurrentExtractionDate)';

  ;

//Loading data from transactional database where data deletion is allow.

NewOrders:

LOAD OrderID,

     OrderDesc,

     OrderQty

FROM

(txt, codepage is 1252, embedded labels, delimiter is ',', msq);

Inner Join(NewOrders)

LOAD OrderID,

     OrderDesc,

     OrderQty

FROM

(qvd)

Where QVD_Stored_TimeStammp >= ‘20150207’ //where the date here is the timestamp of when the data //was last stored.

;

Hopefully this helps

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

There is no facility to update in place or append to an existing QVD. The QVD must be rewritten in it's entirety with a single STORE statement, The script you posted is the only way to "update" a QVD:

1. Collect all rows, including any existing QVD rows, into a single resident table.

2. STORE the resident table to QVD file overwriting any existing QVD file.

-Rob

Anonymous
Not applicable
Author

Thanks for your input.  I must apologize for the title of my last post in which I said in error "Can I add/update an existing .QVD with having to create a new .QVD?  It should have read without having to create a new .QVD?


All I want to do is to take an old .QVD and add new records to it and then re-create it with the combined content.  I believe that Rob's response is the way to go but I am still having trouble with the script.  I will resubmit with my revised script.

Thanks

DAve

Anonymous
Not applicable
Author

Thanks for your input.  I must apologize for the title of my last post in which I said in error "Can I add/update an existing .QVD with having to create a new .QVD?  It should have read without having to create a new .QVD?


All I want to do is to take an old .QVD and add new records to it and then re-create it with the combined content.  I believe that Rob's response is the way to go but I am still having trouble with the script.  I will resubmit with my revised script.

Thanks

DAve