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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register 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

17 Replies
tresesco
MVP
MVP

I am sorry, it's my mistake. Try:

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

Not applicable
Author

new the interval is good but the

count is not working

tresesco
MVP
MVP

Not working - means - no number is coming or the count is not right? Have you tried with Distinct like:

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

Update: And one more silly mistake has to be corrected, for seconds we have to further divide it by one more 60.

Not applicable
Author

no number is comming

tresesco
MVP
MVP

Here on wards, it would be hard helping without a representative qvw. Please share one.

tresesco
MVP
MVP

Well, one more thing you can try:

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

Not applicable
Author

no

i have change the load to

Interval(StopRecordTime-StartRecordTime,'ss') as new_interval,

so it is only in seconds. and now i count a simple if

Count(if(new_interval>20,1,0))

thsnks

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.