Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
JAN. 24, Q&A with Qlik: Making the Move to Qlik Cloud Reporting: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
guptanupur
Contributor II
Contributor II

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

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

1 Reply
petter
Partner - Champion III
Partner - Champion III

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....