Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Round up HH:MM to HH
I am using the following expression in text object
= interval(avg({<A={'a'},Month={'Jul'},AvgAttended={'A'}>}HOUR),'hh:mm')
My requirement is round up hh:mm to hh like below:
If mm>=30 , hh value should be incremented by 1
if mm<30, hh value should be as it is
For example:
Avg | Result |
56:37 | 57 |
25:15 | 25 |
Thanks in Advance....
maybe using round to hour
=interval(round(interval#('56:37', 'hh:mm'), 1/24), 'hh')
=interval(round(interval#('25:15', 'hh:mm'), 1/24), 'hh')
Hi,
use Time(),Second() or minute() or Hour() to achieve desired result.
In your case 56 is hr or min
Your solution is something like this,
if(Second(Time(time#('25:15','mm:ss'),'mm:ss'))>30,Minute(Time(time#('25:15','mm:ss'),'mm:ss'))+1,Minute(Time(time#('25:15','mm:ss'),'mm:ss')))
if(Second(Time(time#('56:37','mm:ss'),'mm:ss'))>30,Minute(Time(time#('56:37','mm:ss'),'mm:ss'))+1,Minute(Time(time#('56:37','mm:ss'),'mm:ss')))
Regards
maybe using round to hour
=interval(round(interval#('56:37', 'hh:mm'), 1/24), 'hh')
=interval(round(interval#('25:15', 'hh:mm'), 1/24), 'hh')
IF(LEFT(Interval(Time(Avg({<A={'a'},Month={'Jul'},AvgAttended={'A'}>}HOUR)),'hh:mm'),2)>=30,
LEFT(Interval(Time(Avg({<A={'a'},Month={'Jul'},AvgAttended={'A'}>}HOUR)),'hh'),2)+1,
Interval(Time(Avg({<A={'a'},Month={'Jul'},AvgAttended={'A'}>}HOUR)),'hh'))
= interval(round(avg({<A={'a'},Month={'Jul'},AvgAttended={'A'}>}HOUR),1/24),'hh')
Thanks for all your Reply...
Now I got the result.
= round(avg({<A={'a'},Month={'Jul'},AvgAttended={'A'}>}HOUR)*24)