Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a QlikView application which I reload at 1 a.m. every day. Sometimes it may be necassary to reload it during the day to get new data.
I want to trigger a different code if it is not the first reload on that day - so I need something like that:
11.07.2016
Midnight: vReloadTimesToday = 0
1st reload at 1 a.m. results in vReloadTimesToday = 1
reload at 3 p.m. results in vReloadTimesToday = 2
12.07.2016
Midnight: vReloadTimesToday = 0
1st reload at 1 a.m. results in vReloadTimesToday = 1
Is there a way to "reset" the value of the variable at midnight?
Thanks for your input.
Regards
Tamara
Maybe define your variable in your load script like
LET vReloadTimesPerDay = Rangesum(If(floor(Today(1)) = floor(ReloadTime()), vReloadTimesPerDay,0),1);
(if you need to start with zero, subtract 1:
LET vReloadTimesPerDay = Rangesum(If(floor(Today(1)) = floor(ReloadTime()), vReloadTimesPerDay,0),1)-1;
)
Maybe define your variable in your load script like
LET vReloadTimesPerDay = Rangesum(If(floor(Today(1)) = floor(ReloadTime()), vReloadTimesPerDay,0),1);
(if you need to start with zero, subtract 1:
LET vReloadTimesPerDay = Rangesum(If(floor(Today(1)) = floor(ReloadTime()), vReloadTimesPerDay,0),1)-1;
)
Hi Stefan,
first one helped a lot. Thanks!
If I use your seconds statement, QlikView won't count up - result is always rangesum(0,1)-1 = 0
Regards
Tamara