Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello qlikers 🙂 ,
I have written a script. But only a small area of the script should be run on a monday.
So for example, today is monday and the script should run the complete script. When we have friday the script should only run the area without the "monday script".
How can I do that?
Thank you in advance! 🙂
You can use an if statement.
e.g.
if WeekDay(today())=1 then
// your statements
end if
or use the sub... end sub
for example
let todayis =num(Weekday(Today()));
sub monday (1)
Data:
load * inline [
test
1
]
;
end sub
sub otherday(1)
Data:
load * inline [
test
2
]
;
end sub
if $(todayis)=0 then
Call monday(1);
else
Call otherday(1);
endif
If weekday(today())=1 then
// Monday script goes here. Here you can put entire script.
else
// Other day script. Here you can put script without Monday part.
endif