Qlik Community

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 
Search instead for 
Did you mean: 
gsaipranathi
Contributor III
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?

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

View solution in original post

tmackay2015
Partner
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