Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Qlik Sense Enterprise
Hello,
I would like to create a task that loads an app every 10 minutes.
However, not all day long - only within a specific time window, for example from 8 a.m. to 6 p.m.
Is there a way to set this up? So far, I’ve only found the option to run it every 10 minutes continuously, or to run it once at specific times—but never repeatedly within a defined time range.
Hi @reporting_neu ,
Edit1: Removed incorrect information.
Edit2: Replaced Exit Script in code with a an error invoking code.
One way to achieve your requirement, is by adding a code into the script to check the time and load if it is within the interval. Else, do not load by invoking an error.
E.g.
Let vNow = Now()
If vNow >= (startpoint) and vNow <= (endpoint)
RunCode
Else
CALL InvokeError('Running outside time interval')
End If
Hi @reporting_neu ,
Edit1: Removed incorrect information.
Edit2: Replaced Exit Script in code with a an error invoking code.
One way to achieve your requirement, is by adding a code into the script to check the time and load if it is within the interval. Else, do not load by invoking an error.
E.g.
Let vNow = Now()
If vNow >= (startpoint) and vNow <= (endpoint)
RunCode
Else
CALL InvokeError('Running outside time interval')
End If
Vielen Dank euch beiden.
Super Idee @HeshamKhja1! Die Lösung ist wirklich gut. Ich habe sie etwas angepasst, sodass das Skript im Zeitfenster zwischen 7 und 18 Uhr läuft.
WENN Num(Now()) >= Num(Floor(Now()) + MakeTime(7,0,0)) UND Num(Now()) <= Num(Floor(Now()) + MakeTime(18,0,0)) DANN
// RunCode like "CALL InvokeError('Running outside time interval')"
ANDERS
EXIT SCRIPT;
ENDE WENN;
Keep in mind that this still reloads the app. It just does so in a different manner (with different code running).
Exactly. It does run every 10 minutes, but if the condition isn’t met (because it’s outside the time window), the rest of the script is not executed, which prevents access to the databases.
And the app is then saved with no data... 🙂
That needs to be taken into account. But we no longer need any data from that point on.
True, @Or solution is better. I did not know we have such control in QMC Tasks.
As for the app being saved with no data, we can invoke an error purposely by calling a non existing function rather than "Exit Script". Example: CALL InvokeError('Running outside time interval'). Then the app won't reload and the previous data will be maintained.
I edited my earlier reply to reflect this as well.
Example:
Mon - Sat every 10 minutes between 08:00 and < 18:00 (last run 17:50)
Explanation of the filter (positions):
Pos 0 – Minute: * (any)
Pos 1 – Hour: 8–17
Pos 2 – WeekDayPrefix: - (none)
Pos 3 – Weekday: 1–6 (Mon–Sat, Sun = 0)
Remaining positions: * (any)