Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
raju_salmon
Creator II
Creator II

How to convert sec to interval?

Hi Expert,

In my data, time is available in seconds which should be shown in hh:mm:ss format.

I have tried using interval function but it is showing wrong result, can anyone help me on this?

Attached qvw file for reference.

Thanks,

Raju

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Interval(SUM([Available Time in Sec]/24/60/60),'hh:mm:ss')

View solution in original post

6 Replies
tresesco
MVP
MVP

Interval(SUM([Available Time in Sec]/24/60/60),'hh:mm:ss')

raju_salmon
Creator II
Creator II
Author

Perfect...Thanks a lot Tresesco.

raju_salmon
Creator II
Creator II
Author

Is there any specific reason why my expression showing wrong result for 2014,2015 and 2016... but not for 2017?

tresesco
MVP
MVP

Is not this what you see?

Capture.JPG

raju_salmon
Creator II
Creator II
Author

If i use the expression which you suggested is working very fine and giving accurate result.

Earlier i tried with below expression, but not sure why it is not working.

Interval((Interval#((Num(SUM([Available Time in Sec]))),'SS')),'hh:mm:ss')

tresesco
MVP
MVP

I guess it's because how qlik is handling the long numbers. It seems that number bigger than 2147483648 (which is 2^31) are being interpreted differently (may be signed bit interpretation). So the discrepancy.