Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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')
May be try this?
Time(Ceil(Frac(Ceil(Sum(Duration),1/1440)), 0.1), 'hh')
Thank you.
Can you tell how to write ceiling the time in minutes.
you mean you want hh:mm ? or only Minutes mm
for suppose, if I selected 30.06 and 19.20, I want the result to be 50minutes mm ceiling
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?
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')
Hi,
Try this.