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

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

time interval less than 20 sec

hello

i have a column 'Interval" which is the interval between 2 timestemps. for example:

00:00:25

00:01:10

00:00:09

in time format.

i need to count all times that are less than 20 seconds and bigger than 0 zeconds

and all times that are bigger than 20 seconds/

thanks

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Interval() is a formatting function. If you see 86400 in seconds coming from interval(1,'s'), that means the back-end number is actually 1.

View solution in original post

17 Replies
tresesco
MVP
MVP

Try like:

Count({<Interval={'>0 <$(=20/24/60/60)'}>}Interval)   // (less than 20 seconds and bigger than 0 seconds)

Count({<Interval={'>$(=20/24/60/60)'}>}Interval)   // (bigger than 20 seconds)


If this doesn't work, please let know how (script expression) the interval field has been created.


Edit: corrected

Not applicable
Author

not working

tresesco
MVP
MVP

Could you share your sample qvw?

Not applicable
Author

Capture1.PNGCapture.PNG

tresesco
MVP
MVP

Please try with $(=) (change highlighted above). Also, share the statement used in the script to calculate Interval field.

Not applicable
Author

could you write the full one again?

Timestamp(floor(StartRecordTime*24)/24) AS StartRecordTime,

     Date(floor(StartRecordTime)) AS StartRecordTime_DateFormat, 

     StopRecordTime as StopRecordTime_Full,

     

      Timestamp(floor(StopRecordTime*24)/24) AS StopRecordTime,

     Date(floor(StopRecordTime)) AS StopRecordTime_DateFormat,

     Interval( StopRecordTime-StartRecordTime,'hh:mm:ss') as interval,

tresesco
MVP
MVP

Try like:

Interval(Floor  Frac(StopRecordTime-StartRecordTime),'hh:mm:ss') as interval,


And then the expression: Count({<Interval={'>$(=20/24/60)'}>}Interval) 

Not applicable
Author

Count({<Interval={'>$(=20/24/60)'}>}Interval)

is the same statement as before/

i am changing the script now

Not applicable
Author

the interval now is not good

it shows me only 24 hours

Capture.PNG