Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
hopkinsc
Partner - Specialist III
Partner - Specialist III

NOW() function not dynamically updating

Hi all,

I have just noticed that the NOW() function does not update unless a manual page refresh is done. Does anyone know of a work around or is this working as designed? 

QlikView does dynamically update (you can watch the time change right in front of your eyes in a text box!) 

7 Replies
sunny_talwar

Not sure if this makes any difference, but can you try Now(1) instead of Now()

sunny_talwar

Actually just tried it and it didn't work.

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Thanks Sunny, It is not just me that is seeing this then. 

What i am trying to do is use the now() function in a dimension to create a distinct key (this is used in an extension object that allows me to create a 'comment' which is then written to xml. the xml is then loaded into the data model, so each 'comment' entry must have a unique key). The now() function would have been perfect for this, but obviously if it does not work like it does in QV then i need to find another way.  

The dimension i am using is this..

='Sheet1 - ' & timestamp(now())

Does anyone know how else i can create a unique key by using a calculated dimension? This is not possible to do in the script as it's the extension object that outputs to xml.

Thanks

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Does anyone have any ideas on how to create a dynamic unique key in a chart dimension?

ArnadoSandoval
Specialist II
Specialist II

Hi @hopkinsc 

It worked for me on the script and the front-end (UI):

Script:

If you take the time on the first Main section of the script (vStartTime) with an expression like TimeStamp(Now()), then, you take the time on the last section (vEndTime) and the script takes a long time, more than 1 second to assign the time stamp to the vStartTime and vEndTime you are able to see that Now() is actually working!

Front-End (User Interface)

  • I created two SET variables, like these two:
Set vTimeStamp = 'TimeStamp(Now())';
Set vTimeFull = '100000000000000 * Frac(Now())';
  •  My Front-End UI has two sheets
  • I created a UI variable: vMySheet with a default value of 1
  • I added TextBoxes for the Set variables, and the vMySheet (as I want to see that the Sheet's action is actually updating it) on the first sheet.
  • The first sheet's action assign 11 to vMySheet.
  • The second sheet's action assign 22 to vMySheet.
  • I changed sheets, the sheets' action worked as the variable vMySheet was updated accordingly! as well as both Set variables, so I was able to see the current time after switching sheets.

I attached my test project

I hope this helps,

Arnaldo Sandoval
A journey of a thousand miles begins with a single step.
hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Hi, thanks for your reply. 

What you have done works yes, but it relies on a sheet refresh (F5). In QlikView, the text box changes like a digital clock, with no need for any sort of refresh. 

Because the functionality is different in Qlik Sense, this stops the function being useful for the purpose i need to use it for, and there doesn't seem to be any other function i can use. 

Note, that as explained above, i am using an extension object and adding a calculated dimension of:

='Sheet1 -' & timestamp(now()). 

The save button on the extension object saves the details to an XML file. The dimension value that is being sent to the XML includes the timestamp of the last time the sheet was refreshed, so multiple entries appear in the XML with exactly the same dimension value. 

The extension object used is inphinity Forms, so you will not be able to test unless you have that. 

inphinity are saying thats its the Qlik Sense functionality that does not work, so they are unable to provide a work around. 

I have asked for a change request in the next release of Forms which outputs the date and time of when the 'save' button is clicked (it currently only outputs the date). 

I will wait for a response from them, thanks for your time anyway. 

ArnadoSandoval
Specialist II
Specialist II

Thanks @hopkinsc 

I will give a try to  Inphinity Forms, I downloaded its trial, waiting for the License!!! It seems an interesting interface for Qlik!

Regards, 

Arnaldo Sandoval
A journey of a thousand miles begins with a single step.