Jump to content
Server Maintenance This Week. ×

Getting the value of one digit in a text string


This topic is 7317 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 )

Link to comment
Share on other sites

This topic is 7317 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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