Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Save $600 on Qlik Connect registration! Sign up by Dec. 6 to get an extra $100 off with code CYBERSAVE: REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
christophebrock1
Contributor II
Contributor II

Convert time to "x hours, x secs"

Hello,


I would like to convert a time to a format like this:

"46h 25min"

So basically, I want the number to exceed the 24 hours in the hour AND HAVE "h" and "m" as values in my textfield.

I have no clue how to do this... Tried too many things already so looking for help 🙂

for example, I have this:

04:04:38

This would need to become:

"4h 4min"

with the option to exceed the 24 hours if it would be more.

Any thoughts?

Kind regards,

Christophe

1 Solution

Accepted Solutions
rubenmarin

Hi Christophe, can you try?:

=Interval(TimeField, 'hh') &'h '& minute(TimeField) & 'm ' // To add seconds: & Second(TimeField) & 's'

View solution in original post

3 Replies
rubenmarin

Hi Christophe, can you try?:

=Interval(TimeField, 'hh') &'h '& minute(TimeField) & 'm ' // To add seconds: & Second(TimeField) & 's'

mtucholski
Creator
Creator

Hello,

take a look at a file sample. I used Dual() function

https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/FormattingFunc...

You can find Dual() used in load script and in chart's expression. Pick whatever you want .

Please take a look at number settings in both document and chart properties.

cheers

christophebrock1
Contributor II
Contributor II
Author

Thanks, this worked like a charm!