# Getting the value of one digit in a text string

This topic is 6494 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

##### Share on other sites

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

##### Share on other sites

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

##### 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 )

##### Share on other sites

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

## Create an account

Register a new account