Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Schedule reload with.bat

Hello everyone,

Because I have some trouble with scheduled reload on QMC, i would like to schedule a reload with a bat file (and then using Windows task sheduler).

The thing is I have dependant tasks. 4 applications must be reloaded one after another.

So far, I have just writen

"C:\\Program Files\Qlikview\Qv.exe" /r "\\blabla\App_1.qvw"

"C:\\Program Files\Qlikview\Qv.exe" /r "\\blabla\App_2.qvw"

"C:\\Program Files\Qlikview\Qv.exe" /r "\\blabla\App_3.qvw"

"C:\\Program Files\Qlikview\Qv.exe" /r "\\blabla\App_4.qvw"


But even if one fails, the following one are reloaded and I don't want that.


How can I specify that I want to stop the execution of the bat file  if one task fails ?

Thanks for your help

1 Solution

Accepted Solutions
Not applicable
Author

Hi Laura,

You can but in a roundabout way.

If you turn on logging in the Qlikview document  - this can create a logfile of the script that you can check in your batch script.

The batch syntax is "findstr"

EG:

Rem *** Check the logfile for errors by doing a string search
type "BatchExample_loading.qvw.log" | findstr /I /C:"Error:"

Rem ***if the text "Error" is found, output to a file, othrwise some other action
if %errorlevel%==0 (
echo %date% %time% Error occurred - Log lines found are: >ErrorDetails.txt
type "BatchExample_loading.qvw.log" | findstr /I /C:"Error:">>ErrorDetails.txt

) else (

[another action!]

......

Remember not to include the date in the logfile name when you set this as an option in QlikView. Otherwise the script will not find the file!

Erica

View solution in original post

15 Replies
Not applicable
Author

From what I know , that is not possible.

There is no enginee to monitor if it fails and to halt it.

Not applicable
Author

Ok, thank you for your answer ako

Not applicable
Author

Hi Laura,

You can but in a roundabout way.

If you turn on logging in the Qlikview document  - this can create a logfile of the script that you can check in your batch script.

The batch syntax is "findstr"

EG:

Rem *** Check the logfile for errors by doing a string search
type "BatchExample_loading.qvw.log" | findstr /I /C:"Error:"

Rem ***if the text "Error" is found, output to a file, othrwise some other action
if %errorlevel%==0 (
echo %date% %time% Error occurred - Log lines found are: >ErrorDetails.txt
type "BatchExample_loading.qvw.log" | findstr /I /C:"Error:">>ErrorDetails.txt

) else (

[another action!]

......

Remember not to include the date in the logfile name when you set this as an option in QlikView. Otherwise the script will not find the file!

Erica

Not applicable
Author

Hi Erica,

Thanks for your answer. I understand the method   but I first need to look up for shell languages tutorials because I am not sure I am able to adapt it  (all I had done was to paste the piece of code to execute the qlikview application)

Have a good day

marcus_sommer

If the update from a qvw was successfully could you read from the filetime(). First before you start your batch and then while the batch-steps. I think you could this integrate in your batch but it could be easier to use vbs as batchfile especially if some additionally steps are requirred like checks or logging. See here various possible methods:

QlikView Maven: QlikView Command Line and Automation

Re: Batch File

Re: Batch file to create a new .qvw and save to a folder

- Marcus

Colin-Albert

Scheduling tasks to run on successful completion of another task is straightforward on the QMC.

This will stop the task when one step fails

The QMC also supports sending email alerts when jobs fail (or succeed).

Isn't it simpler to resolve the QMC issues. rather than creating a workaround that is outside the control and logging of QV server?

Not applicable
Author

The thing is I really want to receive an email when the tasks succeeds but I cannot do it without Publisher...

Colin-Albert

QV Server Small Business can integrate with your email server and can notify you and your users when a task fails but not email on successful completion.

By adding the date & time of the last successful load on your app using reloadtime(), you can indicate when the data was last refreshed. Also the Access Point thumbnails indicate the time of the last reload so your users can see if the data has been updated there.

maxgro
MVP
MVP

if you don't want too use batch may be you can do in qlik, use a file with 4 lines, one for App_n and the status

when the App_n starts

     set the status KO

     check status of previuos app (if any), if not OK exit

when it ends, set status (OK/KO)