Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
This is a really basic question. How do I write out a text search string so that it only selects when the whole word appears, not when it appears as part of another word? For example, I want to select any time esophageal appears, but not "transesophageal".
I can do it by placing a space in front of the word, when I am doing a single search, but as part of a longer string (eg (* esophageal*|*bronchoscopy*), it no longer works
when placed in the longer string only the bronchoscopy items came through and none of the esophageal...
Thanks!
I think I figured out how it works - if you are using the OR search syntax ( | ) and want to use wildcard search, quote every search string in double quotes, like this:
("* esophageal*"|"* bronchoscopy*")
If they have no spaces inside, then the double quotes are not necessary.
Alternative is to use normal search which should be the best for this case. Just enter:
esophageal bronchoscopy
as the search term - no wildcards, no quotes, parentheses or anything else necessary, only search terms separated by spaces - and it will find all strings where either term appears as a full word. Which is incidentally how Dhruv Sampat idea which pointed me in right direction works, it just searches for (, |, and ) as additional words
try something like:
Assuming your field is called Field1
If((Field1) like 'esphageal*' or (Field1) like '* esphageal *' , 'esphageal' ,
If((Field1) like 'Bronchoscopy*' or (Field1) like '* Bronchoscopy*' , 'Bronchoscopy' , Field1)) as Field2
*CAR* means that you are searching all the string that contains CAR so you find 'MY CAR' or 'CAR RED'
If you search for CAR* you will find only CAR RED because you are searching for strings starting with CAR and followed by any other string
If you serach 'CA? COLOUR *' you will find all strings starting with CAA, CAB ... CAZ followed by COLOUR and all other strings after
Hope it helps
Wow, weird, I'd expect it to work. Either it's a bug or the search OR operator is not very intuitive...
In the meantime, try this as search text instead (make sure there is nothing else in search input field, the equal sign in front is essential):
=WildMatch(CNC_PROCEDURE_DESCRIP,'* esophageal*','* bronchoscopy*')
The best way is to NOT use the * as the wildcard. Use the space before and after " _esphageal_ | _bronchoscopy_ "
If this helped you, please mark as Helpful. If it solves your issue, please mark as Answer
Regards
Dhruv
I think I figured out how it works - if you are using the OR search syntax ( | ) and want to use wildcard search, quote every search string in double quotes, like this:
("* esophageal*"|"* bronchoscopy*")
If they have no spaces inside, then the double quotes are not necessary.
Alternative is to use normal search which should be the best for this case. Just enter:
esophageal bronchoscopy
as the search term - no wildcards, no quotes, parentheses or anything else necessary, only search terms separated by spaces - and it will find all strings where either term appears as a full word. Which is incidentally how Dhruv Sampat idea which pointed me in right direction works, it just searches for (, |, and ) as additional words
type without *
Methods that worked:
Normal search and just putting the words in (how did I not try that sooner?)
Quotation marks and no wildcards.
.
The Wildmatch function option also worked.
Things that didn't work (in addition to the ones in the original question)
Spaces before and after with quotation marks.
Thanks so much for all the help!!