1 Reply Latest reply: Jul 9, 2018 3:18 AM by Petter Skjolden RSS

    How to give reload schedule in qlik sense through load script and not in QMC ?

    Nupur Gupta

      Hi ,

         How to give reload schedule in qlik sense through load script and not in QMC ? I want to control the load through script level

        • Re: How to give reload schedule in qlik sense through load script and not in QMC ?
          Petter Skjolden

          You can store the time and/or date in a text file through the STORE statement. Then you can have a small load script being run every minute, five minute, 10 minute, hour or whatever kind of resolution you need to check if the time in the text file has arrived or been passed and then run the rest of it's load script or exit (and wait for the next check interval).

           

          // Load script that controls when a script should start:

           

          vTimeToStart = Date(Today() + 1/24);  // in an hour

          TIMETOSTART:

          LOAD * INLINE [

          TimeToStart

          $(vTimeToStart)

          ];

           

          STORE TIMETOSTART INTO LIB://myScriptFolder/TimeToStart.txt (txt);

           

          _______________________________________________________________________

          // The load script that are scheduled to check every nth minute, hour or whatever interval

           

          TIMETOSTART:

          LOAD

          *

          FROM

            LIB://myScriptFolder/TimeToStart.txt (txt);

           

          vTimeToStart=Peek('TimeToStart','TIMETOSTART');

           

          WHEN vTimeToStart<=Now() EXIT SCRIPT;

          $(must_include=LIB://myScriptFolder/TheRealScript.qls);

           

          This can of course be extended to write the name of the script that should be run so you can have a generic check and start routine instead....