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: 
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)