Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Hello dataikers,
I would like to know if one date is part of two distincts dates.
For example, if this date is superior to this date and inferior to this one, then put a 1 in the column or a 0 if it’s not.
I know that i have to use a IF function but it doesn’t seems to work !
Thank for your help 🙂
Hi,
As mentioned in this thread comparing data with < > is not directly supported.
You can use something like :
if(diff(date_column.asDate(), '2018-01-01'.asDate('yyyy-MM-dd'), 'seconds') < 0 , 1, 0) && if(diff(date_column.asDate(), '2017-01-01'.asDate('yyyy-MM-dd'), 'seconds') > 0 , 1, 0)
This would return True/False if the date is > 2017-01-01 and < 2018-01-01.
Let me know if this helps.