Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
jeevays7
Partner - Creator III
Partner - Creator III

Getselectedcount for filtered list box

Hi,

I have a list box in qlik sense using $Table field and i have applied a filter condition in this list box.

Ex: IF($Table<>'Table1',$Table)

when i select a value in the above list box, the getselectedcount($Table) fucntion is not working correctly and it is always showing "0".

How to fix it?

1 Solution

Accepted Solutions
sunny_talwar

Try this as a filter box expressionCapture.PNG

=Aggr(Only({1<$Table -= {'DATA'}>} $Table), $Table)



View solution in original post

10 Replies
petter
Partner - Champion III
Partner - Champion III

Seems to work fine for me:

2018-06-05 12_11_41-QlikView x64 - Evaluation Copy - [Data Visualization_].png

I used as basis for the Field the Expression:   If( $Table <> 'Sales' , $Table )

jeevays7
Partner - Creator III
Partner - Creator III
Author

For me it is not working Petter.

i am also using the same conditions.

if( $Table <>'CAPITAL_FLOW', $Table)

GetSelectedCount($Table)

jeevays7
Partner - Creator III
Partner - Creator III
Author

Please find my attachment (2nd sheet) and suggest me !

sunny_talwar

Try this as a filter box expressionCapture.PNG

=Aggr(Only({1<$Table -= {'DATA'}>} $Table), $Table)



jeevays7
Partner - Creator III
Partner - Creator III
Author

Thank you very much sunny.

It is working fine now.

sunny_talwar

Awesome, I am glad we were able to help

jeevays7
Partner - Creator III
Partner - Creator III
Author

But i don't know why it happening like this.

Can you explain me? why we need to use aggr() here?

sunny_talwar

I am not entirely sure why, but Qlik Sense is unique in a way it works with calculated dimension using if statement... it is as if it creates a new field of it's own which can't really be used with some of the functions such as GetFieldCount() of GetFieldSelections() etc because it is not using the exact field and you cannot really use calculated dimensions in those functions.

Aggr behaves a little different... why? I am not sure... but it can pick the selection directly in the field... so that is why it works.

jeevays7
Partner - Creator III
Partner - Creator III
Author

Okay, Thanks sunny.