Skip to main content
Product Release Webinar: Qlik Insider airing December 6! REGISTER TODAY!
Showing results for 
Search instead for 
Did you mean: 
Partner - Specialist III
Partner - Specialist III

Remove data from qvw with command line

Hi All,

Does anyone know if there is a way to remove data from a qvw with a command line but by keeping the field names.

I have tried the following...

C:\Program Files\QlikView\qv.exe /nodata C:\Folder\File.qvw

but this removes ALL data including field names which then loses all field formats set in the document properties.

I basically want a way of doing the same thing as FILE>REDUCE DATA>REMOVE ALL VALUES but with a command line instead.

Does anyone know a way?


23 Replies
Partner - Champion III
Partner - Champion III


So you want to save the layout for backup purposes.

Have you considered using the -prj method? This saves the layout complete with formats (but no variable values).

To create the layout backup:

  • Create a folder with the same name as the document and add -prj to the end. eg For Test.qvw, create folder Test-prj.
  • Save the document, and the -prj folder will be populated with the layout data from the model in XML format.
  • Point your backup to all files in the -prj folders.
  • The XML files with changes will be updated each time the model is saved (which will happen after scheduled reloads).

To recreate from the backup:

  • Close the document if it is open. If the document is lost, create a new, empty QVW file with the same name.
  • Copy the XML files from the backup into the -prj folder
  • Open the document. The layout from the XML files will be applied to the document.
  • Reload if necessary.

No special step to run a VBS script...

Hope that helps


Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Partner - Specialist II
Partner - Specialist II

If you still need the command line option, you could add this code at the end of your script which seems to do the trick - it just inner joins each table with null values. Just pass the parameter in the cmd line to trigger it ...

If '$(vUnload)' = 1 then

    For t = NoOfTables()-1 to 0 step -1


        tbl = TableName(t);

        fld = FieldName(1,'$(tbl)');

        let cmd = 'Null() as $(fld)';


        inner join ($(tbl))

        Load $(cmd) autogenerate 1;


    next t;

End If;

vUnload = 0;

C:\Program Files\QlikView\qv.exe /r /vvUnload=1 C:\Folder\File.qvw.


Not applicable

Use this VBS:

Set MyApp = CreateObject("QlikTech.QlikView")

Set MyDoc = MyApp.OpenDoc("Sample.qvw","","")

Set ActiveDocument = MyDoc




Set MyDoc = Nothing

Set MyApp = Nothing

Partner - Creator III
Partner - Creator III

if it is for backup purposes why dont you try the reduce option in the QMC and backup the qvw produced by the backup?

the only thing that you will loose is the script , but you will have the app with the data and the full GUI objects.

sounds weird but i think its a creative way to do it with just using the qmc

Not applicable


Inspired by flipside's response, I try doing something like this:

Create a variable vExit with no value. Then put this code after initial SET definitions:

if $(vExit) = 1 then

  trace('Stopping Data Load');

  LET vExit = 0;

  EXIT Script;


  trace('Running Script');


Then pass vExit=1 in command line (from qlikview folder): Qv.exe /r /vvExit=1 c:\Path\to\Sample.qvw

This way you should get a qvw with no data at all. I am rather new to QlikView and still checking if this method has any downsides, but I hope to use it with SVN synch (before commit).



That works fine. I've implemented that myself. The disadvantage is that you need to modify the script of the document first.

Another solution I have used is creating an excel file with a list of file names and run a vba macro in excel to create a Qlikview instance, open each qvw file in turn, remove its data, and finally save and close the file.

talk is cheap, supply exceeds demand
Contributor III
Contributor III

Thanks, it works fine.

Not applicable


   can you please share your sample script, even I too need this coding for me.


Contributor III
Contributor III

Hi Srinivasan,

the code is:

Set MyApp = CreateObject(QlikTech.QlikView")

Set MyDoc = MyApp.OpenDocEx("sourcePathFile&docFileName", 0, False)

Set ActiveDocument = MyDoc




MyApp.Sleep 2000


Set MyDoc = Nothing

Set MyApp = Nothing

There are some little difference due to my Windows Server (release 2012). The first is MyDoc.GetApplication.Quit in

MyDoc.CloseDoc() and MyApp.Quit() and the secod is MyApp.Sleep 2000.

It is due to the information load times at the interface opening QlikView Desktop.



Not applicable

But when I am using at the QV script, I am getting object can not be create by Qlikview tech..