Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
stekol61
Creator
Creator

Convert hh:mm:ss to hours

Hi!

I want to convert the timestamps below to hours.

I tried to use the Hour() expression but i doesn't seem to work when hour part is higher than 24h.

Any idea how to solve this?

Ticket IDresponse_time_bh
OP-000001700301102:01:45
OP-00000169752203:19:41
OP-00000168955805:03:43
OP-000001665107278:34:00
OP-000001655877302:03:55
OP-000001653706296:02:07
1 Solution

Accepted Solutions
Vegar
MVP
MVP

the New expression is showing the underlying numeric value of the interval. 102:01:45 is 4,25 days.

To format the New back to no of hours do this

=interval(New, 'h')

View solution in original post

3 Replies
Vegar
MVP
MVP

Try this expression:

=interval(interval#([response_time_bh], 'hh:mm:ss'),'h')

stekol61
Creator
Creator
Author

Hi!

I added the expression (New) to my table but the result doesn't seems to be correct.

The 'response_time_bh' is calculated in the load script. I don't know if this matters?

Ticket IDresponse_time_bhNew
OP-000001700301102:01:454,25
OP-00000169752203:19:410,14
OP-00000168955805:03:430,21
OP-000001665107294:53:3912,29
OP-000001655877318:23:3413,27
OP-000001653706312:21:4613,02
OP-000001653705314:22:2913,10
Vegar
MVP
MVP

the New expression is showing the underlying numeric value of the interval. 102:01:45 is 4,25 days.

To format the New back to no of hours do this

=interval(New, 'h')