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: 
nigel987
Creator II
Creator II

Reduce values in listbox

Hi,

I have a listbox with Year values: 2010 - 2017

I just want to show the values for the last 24 months. Therfore I use:

=Aggr(Only({<Jahr={"=Jahr>= $(=Year(MonthStart(AddMonths(Max(Today()),-24))))"}>}Jahr),Jahr)

This works as expected. I now see only the values 2015-2017

But when I select a Year value, let's say 2016, only 2016 is displayed in the listbox. Is there a way to show 2015-2017 values and only highlight the selected one green (like the standard behaviour)?

Thanks!

Nihal

1 Solution

Accepted Solutions
tresesco
MVP
MVP

try using IF rather than aggr() like:

If ( Jahr>= $(=Year(MonthStart(AddMonths(Max(Today()),-24)))) , Jahr)

View solution in original post

2 Replies
tresesco
MVP
MVP

try using IF rather than aggr() like:

If ( Jahr>= $(=Year(MonthStart(AddMonths(Max(Today()),-24)))) , Jahr)

nigel987
Creator II
Creator II
Author

Thank you!