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: 
BoXiangWang
Contributor III
Contributor III

How to add condition in a single selection filter pane?

Hello all,

I have a filter pane in which I use the expression below to only allow the users to select a year once at a time.

=aggr(only([Year]), [Year])

Now my data set contains some future date, for instance, 2075 which I do not want to show up in the filter. 

Is there any way, like set analysis, to allow me to adjust the filter without changing my data model?

I tried to add a set analysis within only(), but regarding the definition, it will only give me null().

Here is the screenshot of the filter pane:

BoXiangWang_0-1710318999662.png

 

 

Labels (1)
3 Replies
qv_testing
Specialist II
Specialist II

Try this 

=if(Year <= Year(Today()),Year)

BoXiangWang
Contributor III
Contributor III
Author

I still want the user can only select one year at a time (single selection).

By adopting your suggestion, a single selection is not available. 

Is there any way to combine the conditional expression with the single selection?

marcus_sommer

You may try: =aggr(only({< [Year] = {"<=$(=year(today()))"}>} [Year]), [Year])