Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out 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

Labels (1)
1 Solution

Accepted Solutions
tresB
Champion III
Champion III

try using IF rather than aggr() like:

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

View solution in original post

2 Replies
tresB
Champion III
Champion III

try using IF rather than aggr() like:

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

nigel987
Creator II
Creator II
Author

Thank you!