Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
peter_turner
Partner - Specialist
Partner - Specialist

Time in QlikView, in num() format

Hello!

Could someone tell me how QV gets the number value used for the time?
It must be something like the time in seconds since 1970 or something??

E.g the value 40294.72818287

What i would like todo is count how many rows of data fall into specific time periods, e.g within the last 3 hours, last 6 hours etc etc.
That bit i'm ok with, but i want to be able to select values that are DateTime>= num(now())- 'the number value that is 3 hours e.g 0.006xxxx'

Thanks,
Peter.

1 Solution

Accepted Solutions
Anonymous
Not applicable

Peter,
The integer part is days, the fraction is time as part of the day. So, three hours back is now()-3/24, 6 hours back is now()-6/24

View solution in original post

5 Replies
Anonymous
Not applicable

Peter,
The integer part is days, the fraction is time as part of the day. So, three hours back is now()-3/24, 6 hours back is now()-6/24

peter_turner
Partner - Specialist
Partner - Specialist
Author

Hello Michael,

Thanks for the info, that makes much more sense now!


However i now need alittle help with this expression:
Count ({<MY_DateTimeStamp ={'>=$(now(2)-7)'}>}MY_ID)

This is from a table with the first expression of count(MY_ID) which works fine, but the above SA expression returns the same value as the previous expression.
The now(2) returns the program start timestamp, -7 is 7 days ago, which works fine in a simple text box. Using the $() to return the calculated number for the timestamp.
The field MY_DateTimeStamp has the number value of the datetime.
I think the problem is in the SA expression as it works when i manually enter a date in num format. i.e {>=40111.12345}

Any ideas?

Thanks,
Peter.

Anonymous
Not applicable

It could be SA or data format of the MY_DateTimeStamp field or both. I'm not "fluent" in SA syntax, sorry. Just try playing with it and figure out.
(Maybe it makes sense for you to submit a separate question here. Usualy I don't read posts with many replies - probably most people do the same.)

peter_turner
Partner - Specialist
Partner - Specialist
Author

Hello,

Just to finish my own question, i fixed the syntax, it was a missing =

Correct formular is
Count ({<MY_DateTimeStamp ={'>=$(=now(2)-7)'}>}MY_ID)

Peter.

Anonymous
Not applicable

Sure, makes perfect sense Big Smile