Hi all,
silly question, but I have a column of numbers. I would like to extract the first two numbers from the number string. e.g 997, result 99. The column type is numeric. How do I do this? Thanks!
JC
So the easiest way to do this in one formula is to use TOSTRING and TONUMBER to convert it to a string, get the left characters, and then get the number value back.
Here's an example (replace [yourfield] with your field)
TONUMBER(LEFT(TOSTRING([yourfield]),2))
You can use this formula:
TrimLeft(ToString([Field1]),"2")
Another way to extract the first two numbers from the number string is to convert the column type from numerical to a string using select tool and then to add RegEx tool with an expression like this ^(\d{2}) using parse method. I attached a simple one.
Thanks Claje!
I was trying a combination of these and obviously did not have the right combination. I really appreciate this solution!!
VR
Thanks @Jim7 !
I really appreciate the solution. I will try it out!
Thanks @Bahouth12,
I had thought about running the conversion. This is a great solution and will be trying it out. Thanks for the example too.