Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
PrashantSangle

Run qvw from batch

Hi,

I need your help in windows command to execute qvw files.

I have below scenario.

I have 4 qvw file say a.qvw,b.qvw,c.qvw and d.qvw. Here I need set dependency.

If one of the qvw failed to reload then execution of other qvw must stop.

I have also notice if we run single qvw through batch and if it failed to reload then qv.exe is not getting close.

I need your help to resolve above 2 issue.

To run qvw through batch I am using below command

C:\Program Files\QlikView\qv.exe /r D:\Document.qvw

I have refered below thread

QlikView Desktop client command line

Let me know if any questions

Thanks and Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Create a bat file like this:

C:\Program Files\QlikView\qv.exe /r D:\a.qvw

IF %ERRORLEVEL% NEQ 0 (

  exit /b 1

)

C:\Program Files\QlikView\qv.exe /r D:\b.qvw

IF %ERRORLEVEL% NEQ 0 (

  exit /b 2

)

C:\Program Files\QlikView\qv.exe /r D:\c.qvw

IF %ERRORLEVEL% NEQ 0 (

  exit /b 3

)

C:\Program Files\QlikView\qv.exe /r D:\d.qvw

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

13 Replies
syukyo_zhu
Creator III
Creator III

Hi,

Try do it on your script

execute cmd.exe /c ""C:\Program Files\QlikView\Qv.exe" -r "..\..\application\a.qvw"";

execute cmd.exe /c ""C:\Program Files\QlikView\Qv.exe" -r "..\..\application\b.qvw"";

jonathandienst
Partner - Champion III
Partner - Champion III

Create a bat file like this:

C:\Program Files\QlikView\qv.exe /r D:\a.qvw

IF %ERRORLEVEL% NEQ 0 (

  exit /b 1

)

C:\Program Files\QlikView\qv.exe /r D:\b.qvw

IF %ERRORLEVEL% NEQ 0 (

  exit /b 2

)

C:\Program Files\QlikView\qv.exe /r D:\c.qvw

IF %ERRORLEVEL% NEQ 0 (

  exit /b 3

)

C:\Program Files\QlikView\qv.exe /r D:\d.qvw

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

You can set the ErrorMode in the model to prevent stopping on an error

     ErrorMode 1 (default) - stop on error with option to stop or continue

     ErrorMode 0 - ignore error

     ErrorMode 2 - terminate failed on error

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
syukyo_zhu
Creator III
Creator III

Yes of cause,

But i think this isn't necessary in this case.

PrashantSangle
Author

Hi Sir,

can you elaborate what below command do in above script

exit /b 1


Thanks and Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
tamilarasu
Champion
Champion

Hi,

exit [ExitCode]

EXIT -> Quits the CMD.EXE program or the current batch script.

/b  ->  Exits the current batch script.

ExitCode -> Specifies a numeric number. If /B is specified, sets ERRORLEVEL that number. If quitting CMD.EXE, sets the process exit code with that number.

An exit code of 0 means success and 1 or greater means failure.

qlikviewwizard
Master II
Master II

marcus_sommer

A further possibility would be to use vbs-macros instead of command-lines, something like this could be a starting point: Re: Vbs - passing parameters to opendoc or opendocex.

Another way could be to create parameter-files which contain only some text like run/stop or successful/failure or as a variable or a table which are evaluated from the following task-steps. I use such constructs mainly to control OnOpen trigger in QV and Excel but it should be also possible to control various dependencies with these method - whereby I like the suggestions from Jonathan and would start with them.

- Marcus

tamilarasu
Champion
Champion

You can also create a batch file like below,

"C:\Program Files\QlikView\qv.exe" /R "D:\a.qvw" || GOTO:eof

"C:\Program Files\QlikView\qv.exe" /R "D:\b.qvw" || GOTO:eof


"C:\Program Files\QlikView\qv.exe" /R "D:\c.qvw" || GOTO:eof

"C:\Program Files\QlikView\qv.exe" /R "D:\d.qvw"