Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
JustinDallas
Specialist III
Specialist III

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
Partner - Master II
Partner - Master II

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
Specialist III
Specialist III
Author

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
Partner - Master II
Partner - Master II

Im glad it helped.

Regards

Andy

Mark_Little
Luminary
Luminary

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
Luminary Alumni
Luminary Alumni

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