Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
Does anyone know of a way to automate the opening of a QV application, making a selection and extracting a table as a .CSV file or into Excel?
Can this be done with a batch (.BAT) file?
Thanks.
Hi
You should use macro for OnOpen document action and then loop through selections and export data from table to excel file. If you open it from bat file - it should work.
Cheers
Darius
1. Make *.bat: to reload file
"C:\QlikView\qv.exe (or similar)" /r "[your Qlik file with full path]"
2. Write macros and execute it OnPostReload
ect.ActiveDocument.Fields("SomeField"). Select "SomeValue"
Set obj=ActiveDocument.GetSheetObject("CH01")
obj.ExportBiff "ExportFilePath"
Good luck,
Justinas
Thanks
Is it possible to call the macro from the batch file?
Biff is an image format isn't it? Is it possible to export the actual figures?
Ah, sorry, should have checked first. I can see it's an xls format. Can it output as csv?
Doh! I've found that too now. I really should search the forum before posting my questions!
Okay, so I've found out most of what I wanted. All I don't know is whether I can call the QV macro from a batch file (.BAT) can it be done? Or do I have to trigger the macro from a reload?
Here you go:
http://qlikviewmaven.blogspot.com/2008/08/qlikview-command-line-and-automation.html
Here you'll find some information about your issue. With *.bat file you open Qlik document and run macros OnOpen, then close application.
Take care,
Justinas