Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Delete the field contents before the ocurrence of any two letters

Featured Replies

I need to be able to standardize the contents of a field to just the characters after two letters, including the two letters. It's easier to give a few examples rather than describe the calculation:

  • R01AR064810-01A1 -> AR064810-01A1
  • AR064810-01A1 -> AR064810-01A1
  • DA035813 -> DA035813
  • F32NS084680-01A1 -> NS084680-01A1
  • 14SHSP603-01 -> SHSP603-01
  • T32AI007524 -> AI007524

In other words, the calculation needs to examine the text string, find the location of two letters next to each other (there will only be a single occurrence of two letters next to each other in the string), then delete everything to the left of the two letters.

Is such a calculation possible in FMP 12 or 13?

Thanks

How about:

Let ( [
mask = Substitute ( YourField ;  [ "A" ; "@" ] ; [ "B" ; "@" ] ; [ "C" ; "@" ] ; [ "D" ; "@" ] ; [ "E" ; "@" ] ; [ "F" ; "@" ] ; [ "G" ; "@" ] ; [ "H" ; "@" ] ; [ "I" ; "@" ] ; [ "J" ; "@" ] ; [ "K" ; "@" ] ; [ "L" ; "@" ] ; [ "M" ; "@" ] ; [ "N" ; "@" ] ; [ "O" ; "@" ] ; [ "P" ; "@" ] ; [ "Q" ; "@" ] ; [ "R" ; "@" ] ; [ "S" ; "@" ] ; [ "T" ; "@" ] ; [ "U" ; "@" ] ; [ "V" ; "@" ] ; [ "W" ; "@" ] ; [ "X" ; "@" ] ; [ "Y" ; "@" ] ; [ "Z" ; "@" ]  ) ;
pos = Position ( mask ; "@@" ; 1 ; 1 )
] ;
Right ( YourField ; Length ( YourField ) - pos + 1  ) 
)

Note that this assumes a "letter" is one of the 26 upper-case letters of the English alphabet.

Edited by comment

  • Author

That's perfect, and lightning fast to boot. If we ever meet I hope you'll allow me to buy you a beer or whatever liquid refreshment is your preference in thanks.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.