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

How can use WildSearh with GetfieldSelection ?

I need your help on this.

I have a description field that have string value. For example:

"The total revenue in category Country: Australia is 226.67 in 2015Q2, compared to 190.18 in 2014Q2."

I want to filter by Country according to the user selection.

So I was thinking to use this =Pick(WildMatch(description, '*Australia*')+1,'NO','OK')

Using getfieldselections but I don't know how to put * in the script:   =Pick(WildMatch(description, GetFieldSelections(Country))+1,'NO','OK')

2 Replies
sunny_talwar

May be this:

=Pick(WildMatch(description, $(='*' & GetFieldSelections(Country) & '*'))+1, 'NO', 'OK')

swuehl
MVP
MVP

I think the dollar sign expansion needs to return a string that embeds the search value in single quotes, like

=If(WildMatch(Description, $(=chr(39)& '*' & GetFieldSelections(Country) & '*'&chr(39))), 'OK', 'NO')

and if the user may select more than one Country value, the list of values needs to be handled accordingly:

=If(

WildMatch(Description, $(=chr(39)& '*' & GetFieldSelections(Country, '*'&chr(39)&','&chr(39)&'*') & '*'&chr(39)))

, 'OK'

, 'NO')

Both solutions return OK for every Description if no Country is selected, so you may check with GetSelectedCount(Country) in the expression or chart's calculation condition.

See also attached QVW.

You can also create a script based solution maybe like this

Re: Keyword Mapping with Description

Regards,

Stefan