I have an account field that is always 7 digits long. I need to find where the 5th digit is a 7. The number 7 could be anywhere in the account field, but I don't want to capture those. So the StartsWith, EndsWith and RegEx won't work for me. Does anyone have any other suggestions for how to locate these accounts.
So in the 4 examples below, I would only want to return the first 3 accounts.
4300701 |
4300755 |
4040788 |
4470000 |
Thank you!
Leigh
Solved! Go to Solution.
Hi @lwolfram
Without RegEx, this expression could be used in a Formula tool:
IF Right(left(tostring([Account]),5),1)=='7' THEN 'true' ELSE 'false' ENDIF
Hi @lwolfram
You could use this formula:
IF Substring(ToString([Field1]),4,1) = "7" THEN "Yes" ELSE "No" ENDIF
Substring function can get a start and a length to find strings.
Cheers,
Hi @lwolfram
Just cause I've been trying to use the Regex hammer on everything that looks like a nail recently and also it's fun to do things differently from @Thableaus and @CharlieS (But don't tell them that)
REGEX_Match(tostring([Field1]), "\d{4}7\d{2}")
This matches a "7" as the 5 character
Dan
Thank you all! Those are all great Solutions!
User | Count |
---|---|
17 | |
15 | |
15 | |
8 | |
5 |