Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Automate Data Extraction from a QV application

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.

7 Replies
d_pranskus
Partner - Creator III
Partner - Creator III

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

justinasp
Creator
Creator

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

ActiveDocument.Fields("SomeField"). Select "SomeValue"
ect.

Set obj=ActiveDocument.GetSheetObject("CH01")
obj.ExportBiff "ExportFilePath"


Good luck,

Justinas

Not applicable
Author

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?

Not applicable
Author

Ah, sorry, should have checked first. I can see it's an xls format. Can it output as csv?

Not applicable
Author

Doh! I've found that too now. I really should search the forum before posting my questions!

Not applicable
Author

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?

justinasp
Creator
Creator

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