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

sec_to_time in qlikview how to ?

I'm looking for a way to convert second to time fomat in qlikview similar to sql sec_to_time function

For example.

sec_to_time(264)  =>  00:04:24

How can I convert 264 seconds in qlikview to show result as 00:04:24

1 Solution

Accepted Solutions
Not applicable
Author

interval(interval#(YourSecondsFieldName, 'ss.fff'), 'hh:mm:ss.fff')

If you want to round the milliseconds then... interval(interval#(YourSecondsFieldName, 'ss.fff'), 'hh:mm:ss')

View solution in original post

10 Replies
Not applicable
Author

Try this expression...

interval(interval#(YourSecondsFieldName, 'ss'), 'hh:mm:ss')

This should work if your seconds field is simply the number of seconds...i.e. 264, 300 etc.

Hope that helps

Clever_Anjos
Employee
Employee

interval(264/86400), where 264 is your expression and 86400 is fixed (24 * 60 * 60) seconds a day

Not applicable
Author

this one is almost working ... but for some second that is a real number

264.11111111111111111111 ...    for example it gave me - null

but if

264.00 this works fine. how can I correct this ?

Thank you

Not applicable
Author

this one is almost working ... but for some second that is a real number

264.11111111111111111111 ...    for example it gave me - null

but if

264.00 this works fine. how can I correct this ?

Thank you @Christian Ventriglia

phaneendra_kunc
Partner - Specialist III
Partner - Specialist III

i tried "=interval(264.11111111111111111111/86400)" and i got "0:04:24 AM"

what version of QV are you using? mine is 11 SR2

Not applicable
Author

interval(interval#(YourSecondsFieldName, 'ss.fff'), 'hh:mm:ss.fff')

If you want to round the milliseconds then... interval(interval#(YourSecondsFieldName, 'ss.fff'), 'hh:mm:ss')

Not applicable
Author

yes !! thank you it works now  -)

Not applicable
Author

Please mark correct and helpful answers so others are able to find solutions to problems.

Not applicable
Author

@Christian Ventriglia

where exactly can I mark as correct ? I am kinda new , and I couldn't find any link or button to the "correct" answer.

Thanks