Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
shayraber
Creator
Creator

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

1 Solution

Accepted Solutions
sunny_talwar

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

View solution in original post

6 Replies
Anil_Babu_Samineni

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

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
shayraber
Creator
Creator
Author

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()"?

sunny_talwar

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
Creator
Creator
Author

you are right!

thanks!

just checked it now

sunny_talwar

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
Creator
Creator
Author

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