Jump 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.

Getting the value of one digit in a text string

Featured Replies

Hi,

I'm trying to do a calculation like this:

If the first letter of a text field = "A", this field equals X. If the first letter of a text field = B, this field equals Y.

And so on.

How do I tell filemaker to look for the value of a particular digit?

Thanks!

Andrew

FileMaker Version: 7

Platform: Mac OS X Panther

Here's the quick and inelegant answer to your first question.

TextField=Text

OtherField= Calculation

Case(

Left(TextField,1)="A","X",

Left(TextField,1)="B","Y",

"Whatever the field will equal if none of the conditions are met")

As for the second question:

How do I tell filemaker to look for the value of a particular digit?

Check the forum for the Middle, Left, and Right functions. They will pick whichever letter you designate and return that value. I'd suggest the "Quick Parsing Tutorial" by Ugo Di Luca. It will likely answer some of your questions in better detail.

Paul

  • Author

Thanks very much Paul, exactly what I was looking for!

A more efficient solution, if you're wanting to use the entire alphabet, would be to use

Middle( "XYZABCDEFGHIJKLMNOPQRSTUVW", Position( "ABCDEFGHIJKLMNOPQRSTUVWXYZ", gLetter, 0, 1 ), 1 )

Create an account or sign in to comment

Important Information

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

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.