Filtering on Beginning Characters

prototype user shared this problem 10 months ago
Not a Problem

is there a way to filter data based on a match of the beginning characters? The HAS filter matches anywhere in the string.

Comments (3)

photo
1

I relaize how to do predictive seacrhes. However, in the example that you provide the HAS expression is used which allows matches anywhere in the word or phrase. I am looking only to match on the beginning characters of the word or expression. So for example, let's say the data master has a town called Treemont. Using HAS if someone types in "mo" it woudl match. I only want to match on "Tr" or "Tre" or "Tree". I had previously tried using the INDEX function and added a condition to see if result was equal to zero, but that didn't work. Any other alternative would be greatly appreciated.

photo
1

The expression would be this: “SUBSTRING(value, 0, COUNT(search))=search”


You type Tre then search is ‘Tre’


COUNT(search) is 3


SUBSTRING(‘Treemont’,0, 3) is ‘Tre’ (substring cuts the string at the “spaces” between letters so the index 0 is the start of the string and the index 3 is between the two e: 0 T 1 r 2 e 3 e 4 … )


Then SUBSTRING(‘Treemont’, 0, 3)=search is true.


Best,