Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

time calculation

Hi,

I want to display the sum of duration in ceil as default. (when no value is selected in Number Field).

(here as the sum of duration in minutes is more than 60min, so I want the default result to be in hours).

If a value(s) is selected in Number Field, then if sum of duration in minutes < 60, then the result should be in ceil minutes else in ceil hours.

Can this be done in a textbox with expressions?

Please help me with this.

Thanks in Advance.

1 Solution

Accepted Solutions
MarcoWedel

Hi,

one solution could be:

Ceil(Sum(Duration)*If(Sum(Duration)<1/24,1440,24))

QlikCommunity_Thread_305543_Pic1.JPG

QlikCommunity_Thread_305543_Pic2.JPG

hope this helps

regards

Marco

View solution in original post

2 Replies
MarcoWedel

Hi,

one solution could be:

Ceil(Sum(Duration)*If(Sum(Duration)<1/24,1440,24))

QlikCommunity_Thread_305543_Pic1.JPG

QlikCommunity_Thread_305543_Pic2.JPG

hope this helps

regards

Marco

tmackay2015
Partner - Contributor III
Partner - Contributor III

try this

interval( Sum(Duration),

IF(sum(Duration)<(1/24), 'mm', 'hh')

)


this should format the value to display minutes/ or hours but not alter underlying numbers.


this is useful for ordering by value.


-Tom