25 Replies Latest reply: Jan 7, 2016 7:43 PM by BAIKANG CHEN RSS

    How to create a batch file

      Hi

       

      Can some tell me how to develop a batch file??

       

      I want to create one batch file for reading data from file say 'file.txt' and this  'file.txt' contains user information like username, his/her ID, name of the application he/she has accessed etc.

       

       

      Regards

      Avantika

        • Re: How to create a batch file
          Miguel Baeyens

          Hi Avantika,

           

          For batch file do you mean a Windows batch file? If so, is it going to be read from QlikView? Or do you mean you want to create a batch file to schedule a task to reload a QlikView file that reads from a third file? In this case, the answer is put this line (modified if any according to your folders) in an empty .BAT file

           

          "C:\Program Files\QlikView10\qv.exe" /r "C:\File.qvw"
          

           

          Hope that helps.

           

          Miguel Angel Baeyens

          BI Consultant

          Comex Grupo Ibérica

          • How to create a batch file
            Pradeep Kushwaha

            Hi All,

             

            My problem is similer to above one but small difference.

             

            i want to write a bat who can create new instance. below attached code is .vbs code.

            once i run below  vbs scriptit tookover existing qv instance.

             

            set Qv = CreateObject("QlikTech.QlikView")
            set shell = createobject("wscript.shell")

            success = shell.appactivate("Qlikview - [Start Page]")
            Set docObj = Qv.OpenDoc("E:\QlikView\test.qvw,3,false)

            docObj.Reload
            docObj.Save
            Set docObj= Nothing
            Set Qv= Nothing

             

            My problem is  is there any way to open new instance for any reload.

            • How to create a batch file
              Pradeep Kushwaha

              Hi All,

               

              My problem is similer to above one but small difference.

               

              i want to write a bat who can create new instance. below attached code is .vbs code.

              once i run below  vbs scriptit tookover existing qv instance.

               

              set Qv = CreateObject("QlikTech.QlikView")
              set shell = createobject("wscript.shell")

              success = shell.appactivate("Qlikview - [Start Page]")
              Set docObj = Qv.OpenDoc("E:\QlikView\test.qvw,3,false)

              docObj.Reload
              docObj.Save
              Set docObj= Nothing
              Set Qv= Nothing

               

              My problem is  is there any way to open new instance for any reload.

                • Re: How to create a batch file
                  Madu Raju

                  Hi Guys,

                   

                  I have created batch file and scheduled it to through windows task, batch file running, but dashboard doesn't updated with the latest data.

                   

                  When I do manual executing batch file then dashboard is updating, not sure where is the mistake.

                   

                  Can any one come across this scenario.

                   

                  Thanks,

                    • Re: How to create a batch file
                      BAIKANG CHEN

                      Hi Madu:


                      When you do manual executing, did the dashboard stop right after reload or did it automatically save itself and close the program?


                      As far as I know, batch file can only open a dashboard and reload. My guess is no matter how you run the batch file (manually or by windows task scheduler), although it is updating, but it is not automatically save the updated dashboard at the end.


                      Since running windows task scheduler run batch file in the background, you won't be able to click on the save button. That means you need to find a way to save and close the dashboard. I use macro triggered by post reload to save and close the dashboard.


                      Here are the macro script for saving and exiting:

                       

                      ActiveDocument.Save
                      ActiveDocument.GetApplication.Quit


                      Hope that helps.


                      Cheers,


                      PC