Skip to main content
Question

Is it possible to extract just the numeric part of text field?

  • February 28, 2022
  • 0 replies
  • 163 views

I have a field that will contain a number that I need for other activities and know there will be too much push back if the users are asked to go back and modify the data.  The problem is further compounded by a lack of a standard entry format.  My current approach is:

var textlist values = Split([Number test], " ");
var text valOne = Part(ToText($values), 1, ";");
var text valTwo = Part(ToText($values), 2, ";");
var text valThree = Part(ToText($values), 3, ";");

If(ToNumber($valOne) != 0, ToNumber($valOne),
    ToNumber($valTwo) != 0, ToNumber($valTwo),
    ToNumber($valThree) != 0, ToNumber($valThree))​


This will handle the majority of the cases, but I cannot be positive that a user will not have more than two words before the store number and in some cases the user did not leave a space between text and the store number.  I'm not sure I can do much about the latter.  

I'm hoping someone has a more effective solution to this issue.



------------------------------
Paul Peterson
------------------------------
This topic has been closed for replies.

MarkShnierYou
Forum|alt.badge.img+24
Can you post some example of how users enter the data?

------------------------------
Mark Shnier (YQC)
mark.shnier@gmail.com
------------------------------