Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
cancel
Showing results for 
Search instead for 
Did you mean: 
vikasshana
Creator
Creator

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;