This should be an easy one for many of you- but I'm not sure how to proceed.

I have item numbers in my database that are 5-6 numbers followed by two letters- e.g. **685499DG**. I use a calculation to isolate the last 2 letters in a field called BrandCode.

Problem is, we just introduced new item numbers that have only 1 letter at the end- eg. **685499R **and for those items the Brand code is "R".

I need a formula that basically looks for the letters at the end- wether it's 1 letter, 2 letters, etc.

Thank you!

The following calculation will locate all non-numbers 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