Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

JustinDallas
Valued Contributor II

Task Reload: Load every 3 hours, between 0600 and 1800

Hello Everyone,

I have a task that I would like to run every 3 hours between 0600 and 1800.  Currently, the only way I know to accomplish this is to have an Daily load at 0600, 0900, 1200, 1500, 1800.  As you can see, this is fairly verbose and error prone.  I've looked at the Hourly load, but it doesn't seem to have a parameter to limit it within the hours of the day it kicks off.

Any help is greatly appreciated.

5 Replies
ogster1974
Honored Contributor II

Re: Task Reload: Load every 3 hours, between 0600 and 1800

Its frustrating you cannot set an end time.

I take it you have a number of Apps that you want to run on this schedule hence your search for a easier way to trigger.

May I suggest you have an app that you reload using the manual way you've suggested. Then have the rest of your Apps trigger on successful load of that app. Its not perfect but it will mimic what you are trying to do with less reload steps.

JustinDallas
Valued Contributor II

Re: Task Reload: Load every 3 hours, between 0600 and 1800

Thanks Andy, I've taken your advice and have staggered reloads of dummy apps that kick off the other apps.  Like you said, it's not perfect, but it works.

ogster1974
Honored Contributor II

Re: Task Reload: Load every 3 hours, between 0600 and 1800

Im glad it helped.

Regards

Andy

mark6505
Valued Contributor III

Re: Task Reload: Load every 3 hours, between 0600 and 1800

Hi Justin,

Another way you could achive this is using Sub Routines in your script.

So you would wrap each part of your script in a Sub Routine

Like

Sub FIrstPart

.....

END SUB;

Then at the end of the script you can add an if statement to check that the houra matche your desired time else exit script.

Something like

IF LEFT(RIGHT(NOW(),8),2) = 06

THEN

     CALL FirstPart;

ELSE

     Exit Script;

ENDIF;

Basically LEFT(RIGHT(NOW(),8),2) will return the Current hour and if it is equal to 06 it will run your sub routines else it will just exit.

So if build on the above if statement with a match statement or an OR to inculde the other hours and then set up a task to run every hour then it should do what you want with no manual work.

Mark

juraj_misina
Valued Contributor

Re: Task Reload: Load every 3 hours, between 0600 and 1800

Hi Justin,

you can schedule a task to run every 3 hours and check for current time in script:

If(Frac(Now())<0.25 OR Frac(Now())>0.75) then

Exit Scrip;

EndIf

This will of course clear all data from your data model, so I suggest you implement this for the QVD layer and then attach a task reloading the presentation app based on those QVDs.

Hope this helps.

Juraj

Community Browser