Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
bharatkishore
Creator III
Creator III

Date help

Hi All,

I have a date field in a table with 'YYYY-MM' format and i have years from 1950-01 to 2019-01.

Now i need to make all the years which are <=2011-01 to 2011-01.

I have give condition like this 

if(date(Install_Date<='2011-01'),'2011-01',Install_Date) as Install_Date_Dummy, but in the list box i am getting as below:

T.PNG

But for 2011-01 i am getting left side in list box.. can you please tell me how to get all in one format.

Thanks,

Bharat

 

1 Solution

Accepted Solutions
tresesco
MVP
MVP

It's not good practice to use text comparison here. Having said that, for a quick fix, you could try like:

if(date(Install_Date<='2011-01'),Date(Date#('2011-01', 'YYYY-MM'),'YYYY-MM'),Install_Date) as Install_Date_Dummy

View solution in original post

2 Replies
tresesco
MVP
MVP

It's not good practice to use text comparison here. Having said that, for a quick fix, you could try like:

if(date(Install_Date<='2011-01'),Date(Date#('2011-01', 'YYYY-MM'),'YYYY-MM'),Install_Date) as Install_Date_Dummy

bharatkishore
Creator III
Creator III
Author

I tried this as well and this also worked:

date#(if(date(Install_date<='2011-01'),'2011-01',Install_Date))