Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
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
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

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

View solution in original post

13 Replies
prasad_dumbre
Partner - Creator
Partner - Creator

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

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

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
Creator II
Creator II

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
Author

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

psankepalli
Partner - Creator III
Partner - Creator III

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.

Anonymous
Not applicable
Author

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
Creator II
Creator II

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

Anil_Babu_Samineni

May be double quotes missed for your path

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
carlcimino
Creator II
Creator II

DUR!  Thanks!