Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

acbishop2
Contributor

Adding a Decimal to a Duration

Hello All,

I need to add two time values together, but they are in different formats. The first is in h:mm:ss format, and the second is a decimal:

Working HoursOvertime
1:00:001.08
2:23:00

2.20

In other words, I need to add 1:00:00 (1 hour) to 1.08 hours. My desired output is 2:04:80.

I have tried changing the format to duration and the pattern to h:mm:ss, but Qlik is recognizing the 1.08 as 1.08 days (25:55:12), not 1.08 hours.

I appreciate the help. Let me know if you need more information.

Aaron

1 Solution

Accepted Solutions
MVP
MVP

Re: Adding a Decimal to a Duration

Try something like

SET TimeFormat = 'h:mm:ss';

LOAD *,

          Interval(Rangesum( [Working Hours], OvertimeQV) ) as SummedTimes;

LOAD [Working Hours],

           Overtime,

          Overtime / 24 as OvertimeQV

FROM ...;

1 Reply
MVP
MVP

Re: Adding a Decimal to a Duration

Try something like

SET TimeFormat = 'h:mm:ss';

LOAD *,

          Interval(Rangesum( [Working Hours], OvertimeQV) ) as SummedTimes;

LOAD [Working Hours],

           Overtime,

          Overtime / 24 as OvertimeQV

FROM ...;

Community Browser