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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How do i convert to HH:MM

Hi

I have a chart which display the runtime in minutes as 69.77hrs, but the actual value is 69hours 46 minutes

Is there a way in Qlikview where we can convert the value in HH:MM format?

Thanks!

1 Solution

Accepted Solutions
matt_crowther
Specialist
Specialist

Yee-Haw; we're in real cowboy work-around country with this solution - I'm sure there'll be an easier way but as I don't have your actual data it's the only thing I could test:

=floor(69.77,1)&'Hrs '&round((60*(1-((ceil(69.77,1))-69.77))),1)&'Mins' result = '69Hrs 46Mins'.

Replace the '69.77' with the result of your initial formula - essentially it's working out what 77% of 1hr is - the magic 46mins.

Hope that helps,

Matt - Visual Analytics Ltd

View solution in original post

10 Replies
pover
Partner - Master
Partner - Master

Divide your number by 24 and then use the interval function:

=Interval(69.77/24,'HH:mm')

Regards.

Anonymous
Not applicable
Author

My expression is

SUM



(run_time_minutes/60) = 69.77,

if i write =interval(

(SUM

(run_time_minutes/60) /24),'HH:MM'), i am not getting the value i expected.



matt_crowther
Specialist
Specialist

Yee-Haw; we're in real cowboy work-around country with this solution - I'm sure there'll be an easier way but as I don't have your actual data it's the only thing I could test:

=floor(69.77,1)&'Hrs '&round((60*(1-((ceil(69.77,1))-69.77))),1)&'Mins' result = '69Hrs 46Mins'.

Replace the '69.77' with the result of your initial formula - essentially it's working out what 77% of 1hr is - the magic 46mins.

Hope that helps,

Matt - Visual Analytics Ltd

Miguel_Angel_Baeyens

Hello,

Check that the format is case sensitive:

=Interval('69,77'/24, 'hh:mm')


Hope this helps

Not applicable
Author

I've added Num() to your field name because I'm not sure that it is being interpreted as a number. If it is, you can remove the num() around run_time_minutes. This also makes the assumption that the value for run_time_minutes only has two decimal places. If it has more, you could consider using subfield. It's more process intensive though so I'd avoid it unless you have to.

interval#(floor(num(run_time_minutes))&':'&(round(num('.'&right(num(run_time_minutes),2))*60)),'hh:mm')


Anonymous
Not applicable
Author

Thank you , this option works , could you please let me know how do i make the format look like 69:46 instead of '69Hrs 46Mins'

Not applicable
Author

Sorry, Not sure. I haven't seen that before.

pover
Partner - Master
Partner - Master

You can do

=floor(69.77,1)&':'&round((60*(1-((ceil(69.77,1))-69.77))),1)

to get that format.

It's a shame the interval() function didn't work. What result did you get by trying

interval((sum(run_time_minutes/60)/24),'HH:mm')?

Regards.

Anonymous
Not applicable
Author

FOR EXAMPLE : if the value is 52hrs 44min i get result 12

Thank you!