Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

search a value in a Multiple selection

Hi, I have a problem with qlikview.

I have a calendar that I can select multiple values for month. I need to know if when I have selected several months March is selected.

For example:

If ('March' IN selected-months, then condition)

I tried with Match function but this only works if you select only one month.

Any ideas?

Thanks!

1 Solution

Accepted Solutions
ramoncova06
Specialist III
Specialist III

use substringcount inside of a concat

if(SubStringCount(Concat('||' & 'Month, '||'), '||March||')  >0 and GetSelectedCount(Month) > 0,

View solution in original post

10 Replies
sunny_talwar

You may need to use Subfield function when you have multiple months. But the exact expression which can be used can only be determine once you share a sample data or application.

Best,

Sunny

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

In expression:

=If(WildMatch(GetFieldSelections(Month), '*March*'), 1, 0)

Flow control in script:

If WildMatch(GetFieldSelections(Month), '*March*') Then

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

Jonathan, it is not a script function...

ramoncova06
Specialist III
Specialist III

use substringcount inside of a concat

if(SubStringCount(Concat('||' & 'Month, '||'), '||March||')  >0 and GetSelectedCount(Month) > 0,

Anonymous
Not applicable
Author

Try this,

if(SubStringCount(getfieldselections(urmonthfield),'March')>0, then condition)

Anonymous
Not applicable
Author

considering you would want to do it in the front-end.

Not applicable
Author

Thanks for all, I tried:

 

=substringcount(concat(DISTINCT Mes),'mar')

And it´s works perfectly

anbu1984
Master III
Master III

If (Index(GetFieldSelections(MonthField), 'March'), 'Present','Not')


Or


If (GetFieldSelections(MonthField) Like '*March*', 'Present','Not')

Anonymous
Not applicable
Author

There is a difference between using concat() and GetFieldSelections().  If you use concat(), it would react on all available values, not just selected values - which is not the same.  Your request was about the selected values, so concat() is not the right function for this requirement.  Well, if it works for you - you know better what's really required.

Second, the correct answers was given by Jonathan (if use GetFfieldSelections) and by Ramon (if use concat).  They deserve at least "helpful" points.  Marking your own answer as correct is fine of course, especially if there were no other good answers, but it doesn't add you points anyway.