Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
IMPORTANT security patches for GeoAnalytics Server available to download: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
gsaipranathi
Contributor III
Contributor III

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')

gsaipranathi
Contributor III
Contributor III
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

gsaipranathi
Contributor III
Contributor III
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