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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
geogou1973
Creator
Creator

Convert time 'hh' into number

Hello,

Have anyone an idea how can i convert the following expression that i have it in an variable into number ?

=time(time(now() - 1/24,'hh:mm'),'hh')

this variable returns only the current system hour 'hh' minus 1

I want this because i have this variable in a straight chart and when the user tries to scroll down automatically the cursor returns to the top because the server calculate the time every second and i want to avoid this.

Thank you in advance.

Labels (1)
1 Solution

Accepted Solutions
Peter_Cammaert
Partner - Champion III
Partner - Champion III

what about :

=time(time(now( 2 ) - 1/24,'hh:mm'),'hh')

View solution in original post

6 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

Avoid using the now() function. It will repeatedly trigger frequent evaluations.

Did you try using the LocalTime() function?

geogou1973
Creator
Creator
Author

Hello Peter,

I have the same problem like before.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Is it really necessary to have an updated time value? Can't you set it in your load script?

Peter_Cammaert
Partner - Champion III
Partner - Champion III

what about :

=time(time(now( 2 ) - 1/24,'hh:mm'),'hh')

geogou1973
Creator
Creator
Author

It works, what is doing the number 2  ?

Peter_Cammaert
Partner - Champion III
Partner - Champion III

IMHO it's always a good idea to check out what you get for free (or Qlik may decide to stop maintaining the docs due to lack of an audience )

now ‒ QlikView

I should add that the QV Desktop Help article is a bit better than the on-line version. The Desktop Help article at least warns you that using timermode = 1 (the default) may have unwanted consequences.