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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
c_latham
Contributor III
Contributor III

Greater than timestamp

Hi All,

I have a CREATION_DATE field which is a timestamp. E.G. 01/01/2018 18:00:00 in the format DD/MM/YYYY hh:mm:ss

I am trying to do a simple If statement whereby the time part of the timestamp is less than 14:30:00.

My code is below, however everything gets the 'N' value no matter what the value is.

IF(time(CREATION_DATE)<='14:30:00','Y','N')

It cant be that difficult, is it?

Thanks!

1 Solution

Accepted Solutions
c_latham
Contributor III
Contributor III
Author

The actual answer i needed was:

If(Num(Frac(CREATION_DATE))<=Num(MakeTime(14,30,00)),'Y','N')

But I'll give it to you because you set me on the right track! Thanks!

View solution in original post

3 Replies
sasiparupudi1
Master III
Master III

If(Num(Frac(Timestamp#(CREATION_DATE,'D/MM/YYYY hh:mm'))<=Num(MakeTime(14,30,00)),'Y','N')

sasiparupudi1
Master III
Master III

Looks like you were comparing num to string..

may be change

IF(time(CREATION_DATE)<=MakeTime(14,30,00),'Y','N')

c_latham
Contributor III
Contributor III
Author

The actual answer i needed was:

If(Num(Frac(CREATION_DATE))<=Num(MakeTime(14,30,00)),'Y','N')

But I'll give it to you because you set me on the right track! Thanks!