# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
cancel
Showing results for
Did you mean:
Contributor III

## 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?

1 Solution

Accepted Solutions
MVP

Hi,

one solution could be:

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

hope this helps

regards

Marco

2 Replies
MVP

Hi,

one solution could be:

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

hope this helps

regards

Marco

Partner

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

Community Browser