Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Delete a QVD file

Hello All,

Currently I am doing an incremental load of a QVD file but occasionally the database will be restored to an earlier state. In this case my QVD file has more data than it should. Ideally being able to delete some data out of the QVD file would be great but if that's not possible is there a way to simply delete the file?

Thanks

Marc

1 Solution

Accepted Solutions
peter_turner
Partner - Specialist
Partner - Specialist

Hello Marc,

How about something like this:

With your database in a restored state, load the record with the latest date.
(maybe select * from table, order by date_filed asc)

Compare this with the latest date in your QVD file.

If the QVD has data newer than the database, do a full reload of the database and store everything back to the QVD
If the QVD has data older than the database, proceed with the incremental load as normal.

For the number of times you restore your database, might be quicker to manually delete the QVD file.

Peter.

View solution in original post

7 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

You can probably do it in VBScript, but why over - engineer the solution? QVD file is a regular file, it can be deleted manually at any time. As far as I understand, the event of the database being restored to an earlier stage is not an everyday event, right?

You can also reduce the data in the QVD file by loading just the amount of data that you need (using where conditions) and then re-writing the original file with the reduced amount of data.

Not applicable
Author

Thanks Oleg,

On any normal system I would say that the database restores should be pretty rare but the system that I am dealing with has a pretty volatile database and is restored on a monthly basis. Lovely right?!?!

Anyway, so you are saying that I can just load the QVD with a where clause and then store it over the QVD that already exists? Is there a special command for re-writing or will store work?

Thanks

Marc

peter_turner
Partner - Specialist
Partner - Specialist

Hello Marc,

How about something like this:

With your database in a restored state, load the record with the latest date.
(maybe select * from table, order by date_filed asc)

Compare this with the latest date in your QVD file.

If the QVD has data newer than the database, do a full reload of the database and store everything back to the QVD
If the QVD has data older than the database, proceed with the incremental load as normal.

For the number of times you restore your database, might be quicker to manually delete the QVD file.

Peter.

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Marc,

the standard "store" command will replace the QVD without even asking... you can do something like this:


Transactions:
load
...
from Trans.QVD (qvd)
where TransDate <= $(MyMaxDate)
;
store Transactions into Trans.QVD;


peter_turner
Partner - Specialist
Partner - Specialist

Hello Oleg,

Slightly off topic, but is there a command to just append data to a QVD file? "append Transactions into Trans.QVD"?

At present i'm using the store command to save all my QVD back to disk after every incremenal addition.

Peter.

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Peter,

no, no append... it's always a full re-write.

Oleg

Not applicable
Author

Peter/Oleg,

Thanks for your suggestions they got me on the right track.

Marc