
1. Re: Calculation question
philmodjunk Jul 12, 2017 11:18 AM (in response to mjbenun)1 of 1 people found this helpfulIf there are never letters anywhere but at the end and they are always upper case:
Filter ( YourField ; "ABCDEFGHIJKLMNOPQRSTUVWXYZ" )

2. Re: Calculation question
disabled_brianb Jul 12, 2017 11:31 AM (in response to mjbenun)1 of 1 people found this helpfulFilter ( Upper ( Field 11 ); "ABCDEFGHIJKLMNOPQRSTUVWXYZ" )
im sure there are better ways...
*edit* sorry phil I guess I was responding while you posted.

3. Re: Calculation question
philmodjunk Jul 12, 2017 11:34 AM (in response to mjbenun)1 of 1 people found this helpfulThis is on the those "cats" that can be "skinned" any number of ways. Much depends on how many different ways the data might vary from record to recordwhich we can't see from a single sample.

4. Re: Calculation question
mjbenun Jul 12, 2017 11:35 AM (in response to philmodjunk)Thanks for the reply.. they can be both upper or lower. Is your calc case sensitive?
would I need to add all the lowercase letters as well?

5. Re: Calculation question
TomHays Jul 12, 2017 11:39 AM (in response to mjbenun)The following calculation will locate all nonnumbers following the last number in the string for the field YourField.
If there are no numbers, it will return the entire string.
Let([
theInput = YourField;
_n = GetAsNumber(theInput);
_last_digit = Right(_n; 1);
posn_last_digit = Position(theInput, _last_digit, Length(theInput),1)
];
Right(theInput; Length(theInput)  posn_last_digit )
)
685499DG > DG
685499R > R
AX32154M32XXX > XXX
234rAb > rAb
ABCD > ABCD
Tom

6. Re: Calculation question
disabled_brianb Jul 12, 2017 11:40 AM (in response to mjbenun)1 of 1 people found this helpfulthe filter function is sensitive , but you can use the "upper" or "lower" to control the format you want.
i.e. the original field can be case insensitive, but your calculation to remove numbers can be set to either or

7. Re: Calculation question
TomHays Jul 12, 2017 12:11 PM (in response to TomHays)On further study, I found that the behavior of GetAsNumber() was not quite suitable for this calculation.
My previous calc failed on "234.0dog". It returned ".0dog" instead of "dog". (GetAsNumber() doesn't recognize .0 as part of the number since it doesn't seem to like the trailing zero. It sees "456.1dog" well enough.)
Here is a revised calculation using Filter() that works for all the previous input value formats and
"234.0dog" > dog
Let([
theInput = YourField;
_n = Filter(theInput; "0123456789");
_last_digit = Right(_n; 1);
posn_last_digit = Position(theInput; _last_digit; Length(theInput);1)
];
Right(theInput; Length(theInput)  posn_last_digit )
)
Tom