Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Convert decimal to hours

I have a field (RmoQuantid) this field contains hours used by an employee to perform a task, the time value is in decimal, how to convert hours?

Example:

1.50 to 1:30

1 Solution

Accepted Solutions
Not applicable
Author

Hi Henrique,

Try dividing the field containing the hours by 24 and enclose your calculation it in the Interval() function like this:

interval(sum(hours/24), 'hh:mm')

See attached QVW example.

Borja.

View solution in original post

7 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I would do it like this:

=interval(interval#(1.5*60, 'm'),'h:mm')

-Rob

http://masterssummit.com

http://robwunderlich.com

Not applicable
Author

I am having difficulty in setting up the command syntax, the first time that I see with this problem, can you help me, where the field name should be?

Not applicable
Author

would be to solve this problem:

Where the value is 47.89 should be 47:53 HoursSem título.jpg

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

The field name would replace the "1.5" in the example. Assuming the field name is "Hours",  the expression would be:

=sum(interval(interval#(Hours*60, 'm'),'h:mm'))

See attached example.

-Rob

http://masterssummit.com

http://robwunderlich.com

Not applicable
Author

I'm still having problems did not work, look at the expression used:

div (sum (Aggr (sum (QUANTIDADE_RMO) COD_FUNC_RMO%)), 60)
& ':' &
Mod (Sum (Aggr (sum (QUANTIDADE_RMO) COD_FUNC_RMO%)), 60)

She returns the time but not behind the minutes as shown in the picture
horas.jpg

Hours decimal 47.89 ought bring 47:53 Hr

hours are converted into script

Not applicable
Author

Hi Henrique,

Try dividing the field containing the hours by 24 and enclose your calculation it in the Interval() function like this:

interval(sum(hours/24), 'hh:mm')

See attached QVW example.

Borja.

Not applicable
Author

Thank Borja Rodríguez, worked

I appreciate