Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Community,
I am trying to create a date flag in script, it looked simple but somehow im not able to get it working as required. My date column is in the format 'MMM-YYYY'. what i want to acheive is that if the date has passed then the flag should be set to 0 else 1, but im unable to get it working.
Ive used an expression like below:
if(floor(num(MonthYr))<=floor(num(date#(today(),'MMM-YYYY'))), 0, 1) as MonthYr_Flag,
where the format of MonthYr is 'MMM-YYYY'.
Any help will be greatly appreciated.
IF(Date#(MonthYr,'MMM-YYYY') <= Date(Today(),'MMM-YYYY'),0,1) as Flag
IF(Date#(MonthYr,'MMM-YYYY') <= Date(Today(),'MMM-YYYY'),0,1) as Flag
Thanks Manish