Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Ceil functionality in time

Hi All,

I have a field 'duration' having different values.

Now I want to calculate the sum of them and show the result in 'hours' using ceil function.

Expected result = 4 hrs

Please help me with this.

Thanks in Advance

1 Solution

Accepted Solutions
vishsaggi
Champion III
Champion III

You can try this:

TimeDuration:

LOAD  * INLINE [

Duration

00:30:06

00:30:31

00:37:06

00:47:37

01:19:20

];

LEFT JOIN(TimeDuration)

LOAD Duration,

     //Time(Ceil(Frac(Ceil(Sum(Duration),1/1440)), 0.1), 'hh:ss') AS TimeInt,

     Interval(Sum(Duration), 'mm') AS MinSum

Resident TimeDuration

Group By Duration;

In the front end using

= Interval(Sum(Duration), 'mm')

View solution in original post

7 Replies
vishsaggi
Champion III
Champion III

May be try this?

Time(Ceil(Frac(Ceil(Sum(Duration),1/1440)), 0.1), 'hh')

Anonymous
Not applicable
Author

Thank you.

Can you tell how to write ceiling the time in minutes.

vishsaggi
Champion III
Champion III

you mean you want hh:mm ? or only Minutes mm

Anonymous
Not applicable
Author

for suppose, if I selected 30.06 and 19.20, I want the result to be 50minutes mm ceiling

vishsaggi
Champion III
Champion III

So you do not want Hours to be counted when you select, coz you have a value that has 1 hour 19min 20secs so you do not want to consider 1hour?

vishsaggi
Champion III
Champion III

You can try this:

TimeDuration:

LOAD  * INLINE [

Duration

00:30:06

00:30:31

00:37:06

00:47:37

01:19:20

];

LEFT JOIN(TimeDuration)

LOAD Duration,

     //Time(Ceil(Frac(Ceil(Sum(Duration),1/1440)), 0.1), 'hh:ss') AS TimeInt,

     Interval(Sum(Duration), 'mm') AS MinSum

Resident TimeDuration

Group By Duration;

In the front end using

= Interval(Sum(Duration), 'mm')

qlikviewwizard
Master II
Master II

Hi,

Try this.

Capture.PNG

Capture1.PNG