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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Search a string within a string

Hi

I want to search for a string value within a String.

Ex. if you have something like

Product:

green apple

Big apple

yellow apple

green apple small

red big apple

Search for the word Apple in Product and then return only apple?

Thanks,



2 Replies
Not applicable
Author

Hi

You can use the index function (string functions) to check for apple.

if (index(Product,'apple') > 0, 'Apple')

Regards

Juerg

Not applicable
Author

Try one of the Match functions:

wildmatch( s, expr1 [ , expr2, ...exprN ] )

Compares the string s to a list of strings or string expressions. The

result of the comparison is an integer indicating which of the comparison

strings/expressions that matched. If no match is found, 0 is

returned. The wildmatch function performs a case insensitive comparison.

The wildcard characters * and ? are allowed in the comparison

string.

Examples:

wildmatch( M , 'ja*' , 'fe?' , 'mar' )

where M is 'January' returns 1

wildmatch( M , 'ja*' , 'fe?' , 'mar' )

where M is 'fex' returns 2