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: 
vikasshana
Creator III
Creator III

How to get current year and previous year into a new field

Hi,

I do have a below year field which has data from 2019.

Year
2019
2020
2021

 

now my requirement is to create a new field in the load script to get only current year and previous year. It means currently it is 2021 so I want 2021 and 2020 only in that field and next year is 2022 so that field has to capture only 2022 and 2021.

1 Reply
sergio0592
Specialist III
Specialist III

Hi,

It should works with :

TAB1:
LOAD * INLINE [
ANNEE
2017
2018
2019
2020
2021
]

where ANNEE=year(today()) or ANNEE=year(today())-1;