Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi ,
I have mydate column which return date as 2019-07-08 (YYYY-MM-DD) format, e.g 8th of Jul 2019.
I am trying to compare this field with now () function in a text object. Here is the syntax.
=IF(DATE(TRIM(MAX(mydate )),'MMM')=date(TRIM(NOW()),'MMM'),1,0)
so it would compare Jul=Jul , if this is true then return 1 or 0.
The above syntax is returning 0, please advise how should i approach.
The issue is that Qlik isn't really representing the MMM format as expected when you do the comparison in the "if".
So, either
=IF(Text(DATE(TRIM(MAX(MyDate )),'MMM'))=Text(date(TRIM(NOW()),'MMM')),1,0)
or
IF(Month(MAX(MyDate ))=Month(NOW()),1,0)
will work.
The second statement is simpler.
Hope this helps.
The issue is that Qlik isn't really representing the MMM format as expected when you do the comparison in the "if".
So, either
=IF(Text(DATE(TRIM(MAX(MyDate )),'MMM'))=Text(date(TRIM(NOW()),'MMM')),1,0)
or
IF(Month(MAX(MyDate ))=Month(NOW()),1,0)
will work.
The second statement is simpler.
Hope this helps.