Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
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
Master III
Master III

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')

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