Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
master_student
Creator III
Creator III

expression indicator

Hi,

I would like to make a condition :

IF(MIN_DATE_DEB > time('08:30:00','hh:mm:ss'),'qmem://<bundled>/BuiltIn/plus_g.png',

IF(MIN_DATE_DEB <= time('08:30:00','hh:mm:ss'),'qmem://<bundled>/BuiltIn/smiley2_b.png'))

it seems that it didn't work because I get one picture for all cases.

Any idea please?

Thanks

1 Solution

Accepted Solutions
MarcoWedel

Hi,

did you delete the integer (date)part from your timestamp like suggested in your thread extract field?

Otherwise the comparison > 08:30 will always be true for dates later than 12/30/1899.

Try to extract the time part with an expression like the suggested


Time(Frac(MIN_DATE_DEB))


or maybe


Time#(Time(MIN_DATE_DEB,'hh:mm:ss'),'hh:mm:ss')


One example:



QlikCommunity_Thread_232195_Pic1.JPG



table1:

LOAD *,

    Time#(Time(MIN_DATE_DEB,'hh:mm:ss'),'hh:mm:ss') as MIN_DATE_DEB_TIME;

LOAD Timestamp(Today()-Rand()*100) as MIN_DATE_DEB

AutoGenerate 100;




hope this helps


regards


Marco


View solution in original post

3 Replies
sunny_talwar

Try this:

If(MIN_DATE_DEB > MakeTime(8, 30),' qmem://<bundled>/BuiltIn/plus_g.png', 'qmem://<bundled>/BuiltIn/smiley2_b.png')

MindaugasBacius
Partner - Specialist III
Partner - Specialist III

I am curious will it work with this:

time((8*60+30)/24/60,'hh:mm:ss')

Or still wouldn't work and would be the same as time('08:30:00','hh:mm:ss')?

MarcoWedel

Hi,

did you delete the integer (date)part from your timestamp like suggested in your thread extract field?

Otherwise the comparison > 08:30 will always be true for dates later than 12/30/1899.

Try to extract the time part with an expression like the suggested


Time(Frac(MIN_DATE_DEB))


or maybe


Time#(Time(MIN_DATE_DEB,'hh:mm:ss'),'hh:mm:ss')


One example:



QlikCommunity_Thread_232195_Pic1.JPG



table1:

LOAD *,

    Time#(Time(MIN_DATE_DEB,'hh:mm:ss'),'hh:mm:ss') as MIN_DATE_DEB_TIME;

LOAD Timestamp(Today()-Rand()*100) as MIN_DATE_DEB

AutoGenerate 100;




hope this helps


regards


Marco