Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
danielact
Partner - Creator III
Partner - Creator III

GetFieldSelections with Multiple selections

Is there a way to check if an item is selected when you've selected multiple items in the field?

For example, let's I have a field with values 1-10. I know that if I only have one selection made, I can use GetFieldSelection. If I want to see if 4 was selected, I can use if(GetFieldSelections(num)=4,True)

What if I've selected values 1,2,3,4,5? I can't use the same logic. Is there anything I can use to see if 4 was selected?

1 Solution

Accepted Solutions
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Use SubStringCount() or WildMatch()

     Like

          if(SubStringCount(GetFieldSelections(num,'|'),'4')>0,1)

          or

          if(WildMatch(4,$(=GetFieldSelections(num,','))),1)

View solution in original post

5 Replies
jvitantonio
Specialist III
Specialist III

Hi, use this:

=if(findoneof(GetCurrentSelections(yourField),'4')>0, 'true','false')

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Use SubStringCount() or WildMatch()

     Like

          if(SubStringCount(GetFieldSelections(num,'|'),'4')>0,1)

          or

          if(WildMatch(4,$(=GetFieldSelections(num,','))),1)

danielact
Partner - Creator III
Partner - Creator III
Author

SubStringCount seems to be doing what I want, but I still have a small problem. In the example I gave, there was only a small data set. In my actual data, there are many more values, and there might be a large amount of selections. In GetFieldSelections, when you get above a certain number of selections, it doesn't list each one - it might say '20 of 300'. Is there a way to make it give the full list?

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Yes.Then you have to specify the max number of selections

     GetFieldSelections(num,'|',100) here i assumed you have list box with 100 values.

Celambarasan

Not applicable

Hi,

try this:

getselectedcount(YOURFIELD)

it gives you the number of field selected.