Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

pricewatercoope
Not applicable

Wildmatch on strings

Hi there,

I am new to Qlik so I'd have a question about Wildmatch if anyone can help. I am looking to match some expressions from a field and assign them to a new field depending on the expression that is found.  The problem I am facing is that the syntax I am using does not give me the result I am looking for :

Pick (Wildmatch(Field, '*Secondary School*', '*School*'...), 'Secondary School', 'School') as NewField

In the NewField, both expressions get assigned to 'School' rather than being distinguished between  'Secondary School' and 'School'.

Any ideas on how to solve this would be much appreciated!

Thank you

1 Solution

Accepted Solutions
sunny_talwar
Not applicable

Re: Wildmatch on strings

Your statement looks good because if the WildMatch Finds a match with the first check, it would not need to go the next one... So in that case Secondary School should be picked correctly... may be you need another asterisk between Secondary and School?

Pick (Wildmatch(Field, '*Secondary*School*', '*School*'...), 'Secondary School', 'School') as NewField

5 Replies
pradosh_thakur
Not applicable

Re: Wildmatch on strings

Pick (match(Field, 'Secondary School', 'School'), 'Secondary School', 'School') as NewField

Learning never stops.
sunny_talwar
Not applicable

Re: Wildmatch on strings

Your statement looks good because if the WildMatch Finds a match with the first check, it would not need to go the next one... So in that case Secondary School should be picked correctly... may be you need another asterisk between Secondary and School?

Pick (Wildmatch(Field, '*Secondary*School*', '*School*'...), 'Secondary School', 'School') as NewField

MarcoWedel
Not applicable

Re: Wildmatch on strings

please provide some sample data and your expected result.

thanks

regards

Marco

pricewatercoope
Not applicable

Re: Wildmatch on strings

The answer provided by Sunny worked - thank you, much appreciated!!

MarcoWedel
Not applicable

Re: Wildmatch on strings

thanks for your response.

please close your thread:

Qlik Community Tip: Marking Replies as Correct or Helpful

thanks

regards

Marco