Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Announcing the newest addition to the Qlik Community, Qlik Gallery! Learn More
Not applicable

How delete the qvd file.

Hi All,

Do you know how to use QV script to delete the QVD file?

Thanks.

1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

Re: How delete the qvd file.

First, consider that a STORE statement will overwrite the existing QVD file.

To specifcally delete the qvd file, try an EXECUTE script statement.

EXECUTE CMD.EXE /C del "myqvd.qvd";

-Rob

http://robwunderlich.com

13 Replies
Partner
Partner

Re: How delete the qvd file.

I guess, you have to use Macro for it . . .

MVP & Luminary
MVP & Luminary

Re: How delete the qvd file.

First, consider that a STORE statement will overwrite the existing QVD file.

To specifcally delete the qvd file, try an EXECUTE script statement.

EXECUTE CMD.EXE /C del "myqvd.qvd";

-Rob

http://robwunderlich.com

qlikviewforum
Contributor II

Re: How delete the qvd file.

Thank you Rob!

It is throwing secutiry alert as we didn't set the EXECUTE flag for script for not been set. Could you please help me out to set the same.

Not applicable

Re: How delete the qvd file.

You need to allow Script (Allow Database Write and Execute Statements) in User Preferences/Security tab.

Partner
Partner

Re: How delete the qvd file.

Open the QVW file -> Settings -> User Preferencs -> Security -> Check Script (Allow Database Write and Execute Statements) . Click OK and apply. Save the Document. then it won't prompt security message.

nnd
New Contributor II

Re: How delete the qvd file.

Stefan Walther has a great discussion about it here ; he reviews three techniques.

  1. Delete the files with a macro called from the load script
  2. Delete the files by executing a batch statement
  3. Use a pure load-script statement without giving your script system-access and empty the QVD-files within your load-statement

Notice other answers here have already addressed

  • technique 2 (Rob's answer; EXECUTE CMD.EXE /C del "myqvd.qvd";),
  • technique 1; (Prasad's answer; use a Macro (more specifically by creating a Scripting.FileSystemObject with the CreateObject function) Set objFSO = CreateObject("Scripting.FileSystemObject") )


But Stefan prefers the 3rd technique.


Remember as Sean and Prasanna say, you may need to change security settings:

Macro_SecurityLevel_SystemAccess.png

carlcimino
Contributor

Re: How delete the qvd file.

I updated my security settings and wrote my execute statement.  It still throws this message and makes me click Override.  The script finishes but doesn't delete the file.  What am I missing?

EXECUTE CMD.EXE /c del c:\QlikView\Scorecard\Premium Fact\PremFact.qvd

Re: How delete the qvd file.

May be double quotes missed for your path

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
carlcimino
Contributor

Re: How delete the qvd file.

DUR!  Thanks!