Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Field Value Search - Straight Table

How can we determine if a field in a straight table has a particular String? For exa,ple I would like to check if my field "Country" contains a string "of".

1 Solution

Accepted Solutions
morganaaron
Specialist
Specialist

I'm not sure if there's a function that would look for alpha or numeric characters separately, but you can try using the FindOneOf function, and specifying all the characters you want it to look for, so it'd be something like:

FindOneOf(Name1, 'abcde....'), it'll return 0 where it can't find a match and a number upwards of 0 for the position of the first match it finds, so you could plug that into the Max(..) > 0.. statement as before and it should work.

View solution in original post

5 Replies
morganaaron
Specialist
Specialist

You could use index() which would look to see where your substring appears in the string to do a validity check, so

If(Index(Country, 'of'') > 0, 'Yes', 'No')

Not applicable
Author

Can you please look at the sample attached? This condition always gives me No in a text filed that I've used to display the result. I'm looking for a string in field "Name1"

Thanks!

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

In your test expression, there are multiple values for Name1, so you'll get multiple results. You'll need add an aggregation function like max().

=if(max(Index(Name1, 'As')) > 0, 'Yes', 'No')

-Rob

Not applicable
Author

That's correct. I got it now.

But I have another question. What should be the search string instead of 'As' if I would like to check if there is any alphabet in any of the values in the field? Since there are no regular expressions in Qlikview, how can we determine if field values contain an alphabet or they just contain special chars or a number or a null?

Thanks!

morganaaron
Specialist
Specialist

I'm not sure if there's a function that would look for alpha or numeric characters separately, but you can try using the FindOneOf function, and specifying all the characters you want it to look for, so it'd be something like:

FindOneOf(Name1, 'abcde....'), it'll return 0 where it can't find a match and a number upwards of 0 for the position of the first match it finds, so you could plug that into the Max(..) > 0.. statement as before and it should work.