Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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

Tags (1)
1 Solution

Accepted Solutions
peter_turner
Valued Contributor

Delete a QVD file

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.

7 Replies

Delete a QVD file

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

Delete a QVD file

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
Valued Contributor

Delete a QVD file

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.

Delete a QVD file

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
Valued Contributor

Delete a QVD file

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.

Delete a QVD file

Peter,

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

Oleg

Not applicable

Delete a QVD file

Peter/Oleg,

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

Marc

Community Browser