Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
rbecher
Partner - Master III
Partner - Master III

Now(0) is NOT now!

I don't know if this is a bug or a wrong description in the help file:

now( [ timer_mode] )


Returns a timestamp of the current time from the system clock. The timer_mode may have the following values:

0 Time at script run

1 Time at function call

2 Time when the document was opened 

The real Now(0) Behavior:

Now(0) will return the time of the last preceding script run, as you can see in the attached example. But according to the help description I would excpect the starting time of the current script run..

- Ralf

Data & AI Engineer at Orionbelt.ai - a GenAI Semantic Layer Venture, Inventor of Astrato Engine
Labels (2)
6 Replies
swuehl
Champion III
Champion III

Yes, I would agree that the documentation is kind of weak here.

Since the script execution or 'last preceding script run' is not a point in time, but a period, I think it should state even more precisely (for timer mode 0):

Returns a timestamp for when the script last finished reexecuting.

Or something similar (copied the statement from ReloadTime() documentation. So it's all there, somewhere in the docs...

rbecher
Partner - Master III
Partner - Master III
Author

Right, but I guess the initial intention of this function called "now" was to give the starting time of script run which would be very useful indeed.

Why one should provide two different functions with the same result?

now(0) = ReloadTime()  // during script run

Data & AI Engineer at Orionbelt.ai - a GenAI Semantic Layer Venture, Inventor of Astrato Engine
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

It's been this way since V8, when it was "fixed". See

http://qlikviewnotes.blogspot.com/2010/07/now-trap.html

Rob

rbecher
Partner - Master III
Partner - Master III
Author

Hi Rob,

I know this is an old hat! The question is why it was "fixed" and why the documentation is still the same wrong four versions later..

I'm sure a lot of consultants / clients using this in a wrong way..

- Ralf

Data & AI Engineer at Orionbelt.ai - a GenAI Semantic Layer Venture, Inventor of Astrato Engine
ToniKautto
Employee
Employee

The observed behavior of Now(0) is correct, however the manual is unfortuante not completely clear on the actual behavior. This has now been reported as a docuementation bug (#46375) and will be corrected for future releases.

If you want to se the actual reload time in your application, please consider caling the Now(0) directly or use a SET variable instead of LET to accomplish the expected timestamp in your application.

If you on the other hand are looking for the actual reload time during reload in the script, please use Now(1) as it will give the current time.

Not applicable

Thank you Rob for your answers and your blog.  Without which, I would still be searching for answers like this one.