What is the best way to select a number or string that 'ends with' the number 2?
You can use the Filter Tool with a regular expression or a simple string function, depending on your data type
1. Filter tool with Right() function : RIGHT(TOSTRING([YourField]), 1) = "2".
(This checks if the last character of the field is "2") and great for straightforward cases.
2. Using the Filter Tool with REGEX_Match(2). REGEX_Match(TOSTRING([YourField]), ".*2$")
This matches any string that ends with the digit 2.Gives you more flexibility if your data might include letters, symbols, or varying formats
You can do this a number of ways:
The most straightforward it to simple take the "Right 1" of the string like this:
Right([YourData],1) = "2".
You can also do this by reversing the string and then taking the "Left 1", like this:
Left(ReverseString([YourData],1) = "2".
In the event your data is not a string you can simply wrap your data field with ToString() to force it to be a string, like this:
Right(ToString([YourData]),1) = "2"
Left(ReverseString(ToString([YourData]),1) = "2"
If its helpful, I've also created a video response that shows the same thing: https://youtu.be/TjOS4U_W_0A