Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
hopkinsc
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?

Thanks


23 Replies
Gysbert_Wassenaar

Perhaps with a vbscript script file

Set MyApp = CreateObject("QlikTech.QlikView")

Set MyDoc = MyApp.OpenDocEx("D:\MyFile.qvw",0,False)

MyDoc.ReduceData

MyDoc.SaveAs("D:\MyFile.qvw")

MyDoc.CloseDoc

Set MyApp = Nothing


talk is cheap, supply exceeds demand
hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Hi,

Thanks for your reply.

I don't know what i am doing wrong (im not very good with vbscript).

the vbscript seems to open and save the file but it doesnt do any reduction..

Is there any chance you could take a look to see if there is anything obvious that i am doing wrong please?

I have attached a sample file.

Many thanks

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Does anyone have any ideas please?:)

rustyfishbones
Master II
Master II

Add FIRST 1000 before the LOAD script and it will only load the first 1000 rows

like this

FIRST.png

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Hi Alan,

Thanks for your reply.

we need this to run  automatically in our backup routine. so limiting the load to 1000 rows is not possible.

the vbs option that Gysbert suggested is perfect but can't get it to work.

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Does anyone else know how i could do this please? or maybe perform a limitied load via a command line / vbs?

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Any ideas?

Gysbert_Wassenaar

Well, it would be perfect if you could tell that function to clear all the data. What it actually seems to do is remove the data that isn't selected. I suppose you could add a bogus value to one of the tables, select that value and then reduce the data so only the bogus value remains. Not exactly perfect unfortunately.


talk is cheap, supply exceeds demand
hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Thanks for your help on this Gysbert. i will try that