Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

shayraber
Contributor

ReloadTime() in script

hi,

why when I'm writing in script:

table_temp:

LOAD *,

RELOADTIME() AS reload_time,

....;

and when i write in a text object: "=ReloadTime()"

i get different results?

p.s.

reload takes ~15 sec

value diff is ~4min

Tags (2)
1 Solution

Accepted Solutions

Re: ReloadTime() in script

I am not sure, but could be that the ReloadTime() in the script is the ReloadTime() from the last run.... checking this theory now....

6 Replies

Re: ReloadTime() in script

Yes, You should Reload() now to get equal. And, In text object i believe we will get 10 seconds delay.. Because, QIX reloads script first and then UI

shayraber
Contributor

Re: ReloadTime() in script

Anil,

thanks for the quick reply

but i don't understand

the whole process takes about 10-15 seconds (reload script and UI)

when i'm writing in script "Reload() as ...;

what value is assigned to that field? reloadtime of what? the reload time of the script execution, no?

and also,

once the document was reloaded, saved and reopened - what value is being assigned to the textbox when i write inside "=reloadtime()"?

Re: ReloadTime() in script

I am not sure, but could be that the ReloadTime() in the script is the ReloadTime() from the last run.... checking this theory now....

shayraber
Contributor

Re: ReloadTime() in script

you are right!

thanks!

just checked it now

Re: ReloadTime() in script

I think that is what it is....

Reload1

Capture.PNG

Reload2

Capture.PNG

See how Reload2's reload_time = Reload1's ReloadTime(). I think the reason is because the true reload time is captured at the end of the script. Since you are still running the script while you use ReloadTime() in the script, the ReloadTime() is used from the last reload.

Does this make sense?

shayraber
Contributor

Re: ReloadTime() in script

the answer is what you (Sunny) wrote.

-> when written in script - RelodTime() returns the timestamp of last reload.

the solution is what Anil wrote

-> the way to handle this is to use Now() function in script in order to have pre-calculated field based on the script execution time

Community Browser