Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Abhi999
Contributor III
Contributor III

5 years filter in Script level(Current year to next 5 years)

in Date filed i have years from 2010 to 2040 but i want only from year(today()) to next five years.

i have tried 
year( if("Date"<=AddYears(Today(),5),"Date")) as RequiredYear.

But this logic is giving years from 2010 to 2025.i am expecting 2020 to 202

2 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Try this.

Load * from xyz where (Year(Date) >= Year(Today()) and Year(Date) <= Addyears(Today(),5));

 

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Brett_Bleess
Former Employee
Former Employee

Did Kaushik's suggestion work for you?  If so, do not forget to close out your thread by returning to the post and on his post, use the Accept as Solution button to mark that as the solution to give him credit and let other Members know that it worked.  If you did something different, consider posting that, and then mark that as the solution to close the thread, and if you are still working on things, leave an update.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.