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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
BEKEGE
Contributor
Contributor

Integer to duration

Hello,

I have durations in INTEGER format in a database.

It's integers represent running time in milliseconds.

for example: 1983000 = 00D 00H 33M 03S 00MS because: 1983000/60000 = 33.05 ==> 33min + ((05*60)/100) = 3s

How can I get this time value from the integer in QlikSense?

I tried several functions like time, timestamp or interval, but nothing seems to correspond to what I want to do.

Labels (1)
3 Replies
chris_djih
Creator III
Creator III

use Interval(). The important part is the format parameter.
You may consider first transforming your number into seconds by dividing 100.

Edit: you have to match the correct qlik number by calculating SECOND_Field /86400 as Qlik_SECONDS //(=24h*60m*60s)

If you found help, mark the correct answer and give some likes to ALL contributors, that tried to help.
Sbarro2
Contributor
Contributor

Hello,

Convert this integer to time and change it to the good format. Try this expression : 

TIME(TIME#([Time_field]/1000, 'ss'),'hh:mm:ss')
// The division by 1000 transform milliseconds into seconds.

Best regards.

MarcoWedel

Hi,

another solution might be:

 

MarcoWedel_0-1644268126584.png

 

table1:
Load *,
     Interval(duration/86400000,'d hh:mm:ss.fff') as durationInterval
Inline [
duration
1
10
100
1000
10000
86400
100000
1000000
1983000
1983123
10000000
86399999
86400000
86400001
100000000
171943210
];

 

hope this helps

Marco