Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
bharatkishore
Contributor 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
MVP
MVP

Re: Date help

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

2 Replies
MVP
MVP

Re: Date help

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
Contributor III

Re: Date help

I tried this as well and this also worked:

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