Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
paulyeo11
Master
Master

How to make my year field easy maintenance ?

Hi All

My Year field , i need to add below script :-

=IF(year='2013','13',

IF(year= '2014' ,'14',

IF(year= '2015' ,'15',

IF(year= '2016' ,'16',

IF(year= '2017' ,'17',

IF(year= '2000' ,'00',

IF(year= '2001' ,'01',

IF(year= '2002' ,'02',

IF(year= '2003' ,'03',

IF(year= '2004' ,'04',

IF(year= '2005' ,'05',

IF(year= '2006' ,'06',

IF(year= '2007' ,'07',

IF(year= '2008' ,'08',

IF(year= '2009' ,'09',

IF(year= '2011' ,'11',

IF(year= '2012' ,'12',

IF(year= '2010','10'))))))))))))))))))

My issue is every year i need to amend/edit the above script by add =if(year='2018','18',

it there any way i can make it automatic ? Dont need edit the script yearly ?

Paul

1 Solution

Accepted Solutions
sdmech81
Specialist
Specialist

HI ,

Put expression like:

=If(year>=2004,Right(year,2))

find attachment

Sachin

View solution in original post

8 Replies
paulyeo11
Master
Master
Author

my QVW

rahulpawarb
Specialist III
Specialist III

Hello Paul,

You can make use of below expression:

=Right(year,2)

Regards!

Rahul

paulyeo11
Master
Master
Author

Hi Sir

Your approach work fine.

Now i want to year start from 2004 till current year.

May i know how to make not display year before 04 ?

Paul

dsharmaqv
Creator III
Creator III

Use below

=Date(Date#(year,'YYYY'),'YY')

Using this you will allow you to sort and perform calculation without any issue.

paulyeo11
Master
Master
Author

Hi Deepak

Mr Rahul solution is correct because it able to sort.

Paul

sdmech81
Specialist
Specialist

HI ,

Put expression like:

=If(year>=2004,Right(year,2))

find attachment

Sachin

View solution in original post

sdmech81
Specialist
Specialist

Hope this is what u wanted

U can alter year as u need ..

Sachin

paulyeo11
Master
Master
Author

Hi Sachin

thank you very much it work fine.

Paul