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: 
Not applicable

Help needed with date flag

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.

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

IF(Date#(MonthYr,'MMM-YYYY') <= Date(Today(),'MMM-YYYY'),0,1) as Flag

View solution in original post

2 Replies
MK_QSL
MVP
MVP

IF(Date#(MonthYr,'MMM-YYYY') <= Date(Today(),'MMM-YYYY'),0,1) as Flag

Not applicable
Author

Thanks Manish