Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
On May 18th at 10AM EDT we will answer your QlikView questions live. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
master_student
Creator III
Creator III

condition

Hello guys,

Hope you are very well

I have an expression : =Hour(Date(TIME/1440,"hh:mm:ss"))&'H:' &Minute(Date(TIME/1440,"hh:mm:ss"))&'Min'

The result of this exp is a duration, something like that : 1H:25Min

I need to add a condition if the result > 30Min => display 30 Min, if not display the result

Any idea please.

Thanks

1 Solution

Accepted Solutions
sunny_talwar

Or this:

If(TIME >30, '30 Min', Hour(TIME/1440) &'H:' & Minute(TIME/1440) &'Min')

View solution in original post

5 Replies
robert_mika

Try:

if(Minute(Date(TIME/1440,"hh:mm:ss"))>30,30&'Min',

Hour(Date(TIME/1440,"hh:mm:ss"))&'H:' &Minute(Date(TIME/1440,"hh:mm:ss"))&'Min)

el_aprendiz111
Specialist
Specialist

hi,

=if(frac(Hour(Date(now()/1440,'hh:mm:ss')))<30,'New Mssg',Hour(Date(now()/1440,'hh:mm:ss'))&'H:' &Minute(Date(now()/1440,'hh:mm:ss'))&'Min')

sunny_talwar

Or this:

If(TIME >30, '30 Min', Hour(TIME/1440) &'H:' & Minute(TIME/1440) &'Min')

View solution in original post

MarcoWedel

Hi,

so you want to limit your formatted time field to 30Min, right?

Maybe one way to do so might be:

QlikCommunity_Thread_233814_Pic1.JPG

table1:

LOAD *,

    Replace(Time(RangeMin(TIME,30)/1440,'h@mm')&'Min','@','H:') as TimeLimit30Min,

    Hour(Date(TIME/1440,'hh:mm:ss'))&'H:' &Minute(Date(TIME/1440,'hh:mm:ss'))&'Min' as YourExpression;

LOAD RecNo()-1 as TIME

AutoGenerate 1440;

hope this helps

regards

Marco

MarcoWedel

or as the hour of a time < 30Min will always be 0:

'0H:'&RangeMin(TIME,30)&'Min'

or without '0H:' in the 30Min case:

If(TIME<30,'0H:')&RangeMin(TIME,30)&'Min'

hope this helps

regards

Marco