This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I have a field that has data of varying lengths. i want to create a new field from this field that is the string up to a character which is not in a given set of characters. This is because there are various symbols (letters, punctuation etc) that I would want to use to terminate the field. In SQL, my code looked like
Patindex('%[^-.0-9]%' meaning i wanted to find the spot where the first character that did not match ^,-,., or [0,9].
Anything like this in alteryx? basically, i would want to use a findstring function and be able to look for a character that is not in a given set of values. (i am looking for a general solution, but ifthere is a function specific to finding a character not in ^,-,.,[0,9] that would also be very helpful.)
RegEx or Regular Expressions are available in a few Alteryx tools and will definitely do the trick here. I've attached an example that only keeps the string as long as it is a string of only the characters you specified above using this expression: