Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Get Number of Current Selections

I have a condition where I need to ensure at least 2 current selections have been made.  Does anyone know how to get the number of current selections?

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Do you mean selections in two different fields? If I don't miss anything more simple, this gives you the number of fields with selections in:

=if(len(GetCurrentSelections()),SubStringCount(GetCurrentSelections(),chr(13))+1,0)

If you mean selection within a field,you could use GetSelectedCount() function.

Regards,

Stefan

View solution in original post

3 Replies
swuehl
MVP
MVP

Do you mean selections in two different fields? If I don't miss anything more simple, this gives you the number of fields with selections in:

=if(len(GetCurrentSelections()),SubStringCount(GetCurrentSelections(),chr(13))+1,0)

If you mean selection within a field,you could use GetSelectedCount() function.

Regards,

Stefan

Not applicable
Author

works! thanks!

I am using it in a button enable statement so I just cutout this part:

SubStringCount(GetCurrentSelections(),chr(13))

brian554xx
Contributor III
Contributor III

I would reduce this to

=Alt(SubStringCount(GetCurrentSelections(), Chr(13)) + 1, 0)

so it doesn't have to GetCurrentSelections() twice. (and because I love Alt even more than Excel's IFERROR)