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: 
confusedanalyst
Contributor
Contributor

Searching

Hello, 

I'm  hoping someone can help. I'm trying to search for a particular road name that is contained within a location field. I need to search for A5 but the examples in my data include the following formats:  A5123, A51, A513, A5

Out of all the data, I only want A5. This can appear anywhere in the text field. Sometimes there is a space or a comma after, sometimes there isn't. I've tried "A5 " but the problem is when A5 has nothing after it - eg it is at the end of the text string or on its own. 

Can anyone advise?

Thank you

 

 

 

Labels (2)
4 Replies
KGalloway
Creator II
Creator II

If you're searching in a tiler pane or table, you can use the asterisk character * as a wildcard.

For example, searching "*A5*" (without quotes) will return all strings that match [anything]A5[anything], so A5123, A51, A513, A5 would all be returned.

confusedanalyst
Contributor
Contributor
Author

Thank you  for your reply. However, I only need A5 - I don't want the A5123, A51 etc. Is there a way to do this? Thank you

KGalloway
Creator II
Creator II

You may be able to use substringcount to get this: https://help.qlik.com/en-US/qlikview/May2022/Subsystems/Client/Content/QV_QlikView/Scripting/StringF...

For example:

original_data:
load * inline [
original
A5123
A51
A513
A5
B62845
C10
]
;

NoConcatenate
new_data:
Load
original,
if(substringcount(original, 'A5') > 0, 'A5', 'no A5') as containsA5
resident original_data;
drop table original_data;

This code results in the following data:

KGalloway_0-1674482575661.png

Mark_Winter
Creator
Creator

Try using ^A5