Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator
Creator

batch for save opened qvw no data backup in command line

Hello!

I have created .bat file, and inside there is this code :

"C:\Program Files\QlikView\qv.exe" /nodata "D:\QV\lm\Sa.qvw"

An window of Qlik is then opened with my app without data.

Next I have to save it and close.

How to do it through batch file, via commands?

Labels (4)
1 Solution

Accepted Solutions
Highlighted
Creator
Creator

batch for save opened qvw no data backup in command line

I have found the solution. A lot of these did not work the way I wanted, so I will paste an answer here.
Just in case someone had similar problem like me, and the rest of topics would be not available for them, like it was in my case.

1. Create new notepad file text in folder where You need to erase data and safe template of Your app.
2. Open the file and paste inside :

Set MyApp = CreateObject("QlikTech.QlikView")

Set MyDoc = MyApp.OpenDocEx("DISKDRIVE_LETTER:\PATH_TO_SOURCE_FILE\FILENAME.qvw", 0, False)

Set ActiveDocument = MyDoc

MyDoc.RemoveAllData()

MyDoc.SaveAs("DISKDRIVE_LETTER:\PATH_TO_FINISHED_ERASED_FILE\FILENAME.qvw")

MyDoc.CloseDoc()

MyApp.Sleep 2000

MyApp.Quit()

Set MyDoc = Nothing

Set MyApp = Nothing

3. Change bolded paths above in your script to be correct for Your case.
4. Save file and exit notepad.
5. Right click on text file You have created, to change extension of it to .vbs
**** You have to have enabled "show known extension" on Viewer option in Windows *****

Now it is possible to include this script in Windows Scheduler, and it will create automatically empty of data file.

View solution in original post

1 Reply
Highlighted
Creator
Creator

batch for save opened qvw no data backup in command line

I have found the solution. A lot of these did not work the way I wanted, so I will paste an answer here.
Just in case someone had similar problem like me, and the rest of topics would be not available for them, like it was in my case.

1. Create new notepad file text in folder where You need to erase data and safe template of Your app.
2. Open the file and paste inside :

Set MyApp = CreateObject("QlikTech.QlikView")

Set MyDoc = MyApp.OpenDocEx("DISKDRIVE_LETTER:\PATH_TO_SOURCE_FILE\FILENAME.qvw", 0, False)

Set ActiveDocument = MyDoc

MyDoc.RemoveAllData()

MyDoc.SaveAs("DISKDRIVE_LETTER:\PATH_TO_FINISHED_ERASED_FILE\FILENAME.qvw")

MyDoc.CloseDoc()

MyApp.Sleep 2000

MyApp.Quit()

Set MyDoc = Nothing

Set MyApp = Nothing

3. Change bolded paths above in your script to be correct for Your case.
4. Save file and exit notepad.
5. Right click on text file You have created, to change extension of it to .vbs
**** You have to have enabled "show known extension" on Viewer option in Windows *****

Now it is possible to include this script in Windows Scheduler, and it will create automatically empty of data file.

View solution in original post