Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Horry_Pong
Contributor II
Contributor II

Getselectedcount for field with expression

I am transiting from Qlikview to Qlik Sense and I find that if I construct a filter pane using an expression, I can no longer use the function "getselectedcount" to count the number of items selected. For example in my QS file, I define a field called "Year". Then in filter "B) Year (expression)", I defined an if expression to exclude the value "NA". Then I cannot count its selected value. Is there any way to get the selected count of filters with expression?

In addition, selecting a value in filter B will associate the selection in filter C but not in A. This is not the case in Qlikview and I find this behaviour rather odd. Is that any way to link all these filters together?

Thanks.

Labels (1)
1 Solution

Accepted Solutions
tresesco
MVP
MVP

Yes, using aggr() is the solution I believe. Like: =Aggr(if(Year<>'NA', Year), Year)  , or as you wrote.

View solution in original post

3 Replies
Horry_Pong
Contributor II
Contributor II
Author

Not sure if this is the right way to solve it, but I find that when I change the filter to the following expression, all filters are associated again and the getselectedcount() works too.

=Aggr(Only({<Year= {"*"}-{"NA"}>}Year), Year)

Any comment or further suggestion is welcome. Thanks.

 

tresesco
MVP
MVP

Yes, using aggr() is the solution I believe. Like: =Aggr(if(Year<>'NA', Year), Year)  , or as you wrote.

Horry_Pong
Contributor II
Contributor II
Author

Great and I don't know aggr() can work with if() in this way. Thanks!