3 Replies Latest reply: Nov 1, 2017 11:42 AM by malika ouenza RSS

    Rename Qlikview file after reload

    malika ouenza

      A qlikview app is reloaded daily, it always retrieves data from the current month .  I would like to configure a reload task to save the app with the current year and month, so the previous reloaded version of the last day of the previous months would be available on the server with the old name and would no longer be reloaded,  How can I do this?

       

        • Re: Rename Qlikview file after reload
          Kaushik Solanki

          Hi,

           

          You can do one thing. You can execute the cmd command and create a duplicate of current file and then reload the application.

           

          So when you duplicate it will have old data and after reload you will have a new data in your application.

           

          The command is as below.

           

          EXECUTE cmd.exe /c copy Test.qvw Test_Old.qvw;

           

          This has to be the first line after global variable definition.

           

          Regards,

          Kaushik Solanki

          • Re: Rename Qlikview file after reload
            Massimo Grossi

            add a task after your reload

            the task should copy every day your .qvw adding the month and year

             

             

            LET vFromDir = 'C:\Users\folder\';

            LET vToDir = 'C:\Users\folder\Temp\';

            LET vFromFile = 'applicationtocopy.qvw';

            LET vToFile = SubField('$(vFromFile)', '.', 1) & '_' & Date(Today(), 'YYYYMM') & '.qvw';

            LET vLogFileName = 'applicationtocopy_log.txt';

             

            LET vExecString = 'cmd.exe /c COPY $(vFromDir)$(vFromFile) $(vToDir)$(vToFile) /Y  >>  ' & '$(vLogFileName)';

            TRACE vExecString=$(vExecString);

            EXECUTE $(vExecString);