Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Execute Statement for Qlikview Scripts

Hi all,

I'm trying to figure out if there is a way to execute Qlikview scripts from ANOTHER Qlikview script. I have a large number of scripts that need to run either daily/weekly/monthly, and it's quite tedious to have to open each module and reload the script.

Is there a simple command that executes a given script so that I can house a large number of execute statements in one file? Any help would be much appreciated.

Thanks,

Paul

1 Solution

Accepted Solutions
swuehl
MVP
MVP

You can start QV from the command line and use the reload switch to reload your document, save and close the document. Please check the chapter in your reference manual (AFAIR 7.1 and 7.4).

I would recommend creating some windows batch files to execute these reload tasks and maybe create a windows schedule to run them.

[I assume you don't have a QV server available for scheduled reloads]

You can also execute a windows command from within the script (check also the HELP or fe manual), like

Execute cmd.exe /C C:\BatFiles\Script.bat

View solution in original post

12 Replies
swuehl
MVP
MVP

You can start QV from the command line and use the reload switch to reload your document, save and close the document. Please check the chapter in your reference manual (AFAIR 7.1 and 7.4).

I would recommend creating some windows batch files to execute these reload tasks and maybe create a windows schedule to run them.

[I assume you don't have a QV server available for scheduled reloads]

You can also execute a windows command from within the script (check also the HELP or fe manual), like

Execute cmd.exe /C C:\BatFiles\Script.bat

Not applicable
Author

Do you have a link to that reference manual? 7.1 and 7.3 in the reference manual I found don't appear to deal with any sort of script execution.

http://community.qlik.com/servlet/JiveServlet/previewBody/1794-102-1-1791/QlikView%20Reference%20Man...

I'll do some research on creating batch files to execute each of my scripts - thanks for the idea!

swuehl
MVP
MVP

Well, that's the reference manual for version 10. Current version is 11.2.

But the content is not much different, just look into chapter 6.1 and 6.3 of the linked manual.

Not applicable
Author

Awesome, thank you.

Not applicable
Author

I'm new to creating batch files; could you help me with the syntax? I have something that looks like this:

@echo off

REM execute script

C:\Users\Paul\Desktop\qv.exe /r C:\Users\Paul\Desktop\Test.qvw

It's not loading anything, and I know it's something really close to this. Any ideas?

swuehl
MVP
MVP

You have installed QV to your desktop? Can you start the desktop client from there? Can you open your application just by using

C:\Users\Paul\Desktop\qv.exe C:\Users\Paul\Desktop\Test.qvw

in a shell?

If above is not the real path, usual suspects are spaces in the path, try quoting your pathes, then.

Not applicable
Author

Figured it out! Here it is:

start "" "C:\Program Files\QlikView\Qv.exe" /r "C:\Users\psokolik\Desktop\Test.qvw"

Not applicable
Author

You mention:

"You can also execute a windows command from within the script (check also the HELP or fe manual), like

Execute cmd.exe /C C:\BatFiles\Script.bat"

Does the execute statement within the QV script need to refer to a batch file? If not, I assume I could have script A execute script B with a simple execute statement at the end of the file (and start a chain effect with script C, D...).

If it execute statement in the QV script DOES need to refer to a windows batch file, I assume I can just have the batch file command be to execute the next script in the chain (Script A calls batch file to start script B, script B runs and calls batch file to start script C, etc.)

Which is best?

swuehl
MVP
MVP

No, you don't need to call a batch file, so you can potentially just start the next qv.exe job (haven't tried this, would be interested in if you succeed).

I see one potential issue here:

If you execute a second QV script from the first, the first will not finish until the second does. If you are using a chain of several large QVW, you end up with having all of them open.

While this could still work, this might cause performance issues as well as having the risk of losing all reloaded QVW when something happens at the very end.