Skip to main content
Announcements
Join us on Sept. 17 to hear how our new GenAI Assistant empowers data professionals: REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
paulo_cunha
Contributor
Contributor

Remove a specific year from a list of years

Hello, everybody.

 

I'm trying to do a simple thing in Qlik Sense. I just want to remove a specific year from a list with years, like:

2023

2022

2021

2020

I'm trying to remove the year of 2023. I tried to use the following code:

=if([Moth_Year.autoCalendar.Year]=2023,"NULL" , [Month_Year.autoCalendar.Year])

 

Where Month_Year has the following data:

03/2023 (Month/Year)

02/2023

01/2023

03/2022

02/2022

01/2022

03/2021

02/2021

01/2021

03/2020

02/2020

01/2020

 

But the code I'm using isn't working properly. So I just would like to look for help to try to solve this problem.

 

Att,

 

Paulo

Labels (2)
2 Solutions

Accepted Solutions
Bunim
Contributor III
Contributor III

Try this -

aggr(only({<Month_Year -={'*2023*'}>}Month_Year ),Month_Year )

View solution in original post

BrunPierre
Partner - Master
Partner - Master

The null syntax is "Null()", perhaps this is what you want

=If(WildMatch([Moth_Year.autoCalendar.Year],'*2023*'), null(), [Moth_Year.autoCalendar.Year])

Hope this helps!

View solution in original post

2 Replies
Bunim
Contributor III
Contributor III

Try this -

aggr(only({<Month_Year -={'*2023*'}>}Month_Year ),Month_Year )

BrunPierre
Partner - Master
Partner - Master

The null syntax is "Null()", perhaps this is what you want

=If(WildMatch([Moth_Year.autoCalendar.Year],'*2023*'), null(), [Moth_Year.autoCalendar.Year])

Hope this helps!