Hi all,
I am trying to filter the value that contains number or letters. For example, if the value is 123abc or 123456 or abcdse then true.
Can filter tool do that?
Solved! Go to Solution.
Hi @luo
Sure you can, using regex_match in filter. Here REGEX_Match([Field1], "\w+") is checking whether its a number or letter. If its not a number or letter like "-" the it goes to false.
Input:
Workflow:
Here is a resource on RegEx https://community.alteryx.com/t5/Interactive-Lessons/Creating-Regular-Expressions/ta-p/441412#done
Hope this helps 🙂
hi @atcodedog05 thank you for your information. sorry for the misunderstanding. I mean "and" not "or". Like must contain both numbers and letters. Thank you.
Hi @luo
Here is the formula that will go in the filter
!REGEX_Match([Field1], "[[:alpha:]]+") AND
!REGEX_Match([Field1], "\d+") AND
!REGEX_Match([Field1], ".*\W.*")
1st line is checking that string is not only letter and
2nd line is checking that string is not only numbers and
3rd line is checking that no special characters
So this way the string will have both letters and numbers
Workflow:
Hope this helps 🙂
Nice solve, @atcodedog05. I definitely need to get better at RegEx! 😁
Thanks @atcodedog05 for sharing these formulas, will make my life much easier.