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: 
SebastianRichter
Contributor III
Contributor III

Changing intervall / time format

Dear experts,

I need to change the following time intervall between two events from the format below given by source table into a fixed format hh:mm :

1d 20h 30min

19h 10 min 4sec

3min 12 sec

Thanks in advance.

Labels (1)
1 Solution

Accepted Solutions
Vegar
MVP
MVP

Tricky one.

What if you replace all string parts with a multiplying factor  converting each section to seconds. 

d -> *86400+

h-> *3600+

min -> *60+

sec -> *1+

<end of interval> -> 0

19h 10 min 4sec -> 19*3600+10 *60+4+0

Then you can convert this to a interval.

Interval(interval#(evaluate ([your new expression field]),'s'),'hh:mm')

View solution in original post

1 Reply
Vegar
MVP
MVP

Tricky one.

What if you replace all string parts with a multiplying factor  converting each section to seconds. 

d -> *86400+

h-> *3600+

min -> *60+

sec -> *1+

<end of interval> -> 0

19h 10 min 4sec -> 19*3600+10 *60+4+0

Then you can convert this to a interval.

Interval(interval#(evaluate ([your new expression field]),'s'),'hh:mm')