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: 
Not applicable

ReloadTime() not getting set?

Greetings.

I've had complaints about a QVW I have that the ReloadTime() keeps displaying the time *I* last ran the load (before I distributed the QVWs). The QVWs get delivered pretty much empty, and then the user has them loaded in an overnight process that is called with the OCX. Other system variables seem to be fine, but even though the data is clearly updated, the ReloadTime() remains set to the last time I had done the reload while it was under development.

Heard of this? I can just change it to store the date in my own variable at the end of the run - I was just keen on using system variables where I could.

Thanks.

14 Replies
pdumas
Partner - Contributor III
Partner - Contributor III

Hi,

I already faced this problem because my code was

Set MyVariable=releadtime();

I changed to

Let MyVariable=releadtime();

and everything recovered

Pierre.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

ReloadTime() returns the end of the *last completed* script execution. It is not reset until the script end. It's not generally useful in the script to reflect anything about the current script run.

If used directl in the UI, it does show the correct end time. If used in the script, it reflects the end of the *previous* script run.

Instead of using ReloadTime(), I usually start all my scripts with
LET SCRIPT_START = now(1);

And end them with:
LET LOAD_DURATION = now(1) - SCRIPT_START;

-Rob

pdumas
Partner - Contributor III
Partner - Contributor III

Hi Rob,

I checked my script and I had replaced the ReloadTime function with

Let vScriptReload=today();

Thanks for trick on how to monitor reload duration

Pierre.

Not applicable
Author

Its not in the script that I use it - its in a text box on a screen. So I was hoping it would be set to the last completed script execution. That was the whole point - so the user could see if the data in the QVW was up-to-date. The problem is, the load has been successfully run, multiple times, and the date on the screen is still from two weeks ago, when I last ran it on my pc.

I realize the easy fix is to just stuff today() into a variable, which is what I will do. I had wondered if I was using the system variable incorrectly (and it sounds like I'm not -- must be another fun "feature" with the OCX).

Thanks.

hopkinsc
Partner - Specialist III
Partner - Specialist III

Hi Rob,

How would i then get this displayed in my application?

Chris

suniljain
Master
Master

Write following code in Text Object

=Reloadtime()

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Chris,

Assume in your script you have:

LET vScriptStart = now(1);

LET vLoadDuration = now(1) - vScriptStart;

In your app create a text box with:

='Last Reload: ' & vScriptStart & '
Load Duration: ' & interval(vLoadDuration, 'hh:mm:ss')

-Rob

Anonymous
Not applicable
Author

Hello,

I am usign ReloadTime() but I want to separate the date and the time and the date like the exaples below that I have in two text boxes:

='Hoy es ' & Date(today(),'MMMM') & ' ' & Date(today(),'DD') & ' de ' & Date(today(),'YYYY')

='Son las ' & time(now(),'hh:mm tt')

Now I wat to do the same with ReloadTime(), is it possible?

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I don't think you need to break it into three pieces. You can just do:

='Hoy es ' & Date(today(),'MMMM DD YYYY'')

or ='Hoy es ' & Date(ReloadTime(),'MMMM DD YYYY'')

time(ReloadTime. 'hh:mm tt')

-Rob