14 Replies Latest reply: Mar 26, 2012 9:53 AM by Ralph Jaquez RSS

    Silent Batch Reload of qvw with logs


      I am searching for elegant technique to reload a qvw application, with a .BAT, that produce a log file and that not open pop-up windows if errors during the reload...

      Thanks in advance,


        • Silent Batch Reload of qvw with logs

          Hi Eric

          You can add the following command to a batch file (obviously re-written for your own environment), we have lots of other stuff going on in batch files to update SQL Tables with start/end times but this is the part that calls the refresh:


          CALL "C:\Program Files\QlikView\QV.exe" /r "E:\QlikView\UserQVW\QlikViewFileName.QVW" >> "E:\QlikView\LogFiles\RefreshLogFile.LOG"

          Also, in your load script you should add the following command to ensure that no errors pop-up during processing:


          SET ErrorMode=0

          When you are refreshing locally (in development environment, when you want to see errors) you should change the above line to:


          SET ErrorMode=1


          Good luck,

            • Re. :Re: Silent Batch Reload of qvw with logs

              Hi Nigel,


              I tried your suggestions, it reloads well, but it doesn't produce any LogFile. The only way to produce a LogFile is to check it in the document properties...


              For the errors pop-pup, if I add errors in my script, the popup still appears too...

              • Silent Batch Reload of qvw with logs
                etay elazar

                Hi Nigel.

                I am attempting to use a scheduling tool called ControlM to schedule the reloads.

                ControlM can not work with an application that has a Gui window opening.

                I have attempted to place "CALL" in the bat file pre you suggestion, but still got the reload window.

                Is it you experience that placing the CALL parameter will cause a Silent run - no Gui window with reload script popping up ?


                With Many thanks


                Etay Elazar


                • Silent Batch Reload of qvw with logs


                  SET ErrorMode=0 is very bad practice. Suppose script loads a fact table from database and dimension tables

                  from local CSV files. If the database is down, result will be a small QVW with only dimension tables.

                  This is exactly the error you don't want to ignore.


                    • Silent Batch Reload of qvw with logs

                      To clarify

                      Setting ErrorMode to zero is NOT bad practice, although I could possibly accept that it might not be described as Best Practice.

                      In my situation, setting the error mode to zero was absolutely essential in order to have the overnight refresh function properly and effectively.

                      When I answer questions such as these, I don't want to be writing essays on the why's and wherefore's of when to use something, when not to use it and how to protect yourself from the potential dangers. I am assuming when somebody asks how to switch errors off, that they accept and know of the potential areas for problems and will take steps to protect themselves from it (i.e. to produce log files and read those log files to ensure things are working).

                      In my case, I had over 50 QVW files being refreshed automatically through an SSIS package, I switched error mode off because I didn't want a single failure stopping the whole load process. The SSIS package then read log files to ensure a succesfull refresh had taken place on all files and it sent an email if it found a problem. Works sweet as a nut, did exactly what I wanted it to do, no need to reverse my decision on setting error mode. If I had continued with error mode set to its default value I could potentially have a failure on the first file which stops the whole process because a GUI is then waiting for a response, this means that due to one small failure on one small file, the entire organisation now has no new data and my production issues are a very much higher and more visible problem. In my case, I had one small failure, I know about that failure because I have an email that tells me about it, I can inform the small group using that application that they have no new data but the remainder of the organisation is working as required.

                      I would also accept that there are other way to achieve the same result, perhaps using Publisher to deal with it, perhaps using 50 different batch files on 50 different schedules, but this was discussed and thrown out as an option in our case.


                      So, in summary, nobody has (to my knowledge) in this thread suggested that you ignore errors.

                      • Silent Batch Reload of qvw with logs

                        One can use ex Windows Scheduler to start the BAT file(s). There is an option called "Stop task if it runs longer than .. ". Supposing normal execution takes 1 hour , you can kill it after 4 hours. This handles the case of a popup with error message and allows for normal performance fluctuations.

                        Other job schedulers probably have similar features.