2

Is there a way to calculate a field in ArcMap to be one letter up from another field? I'll never need to go beyond letter 'T', so no worries there.

   Field Ltr| Field NLtr

          a       b   
          b       c
5

You can use this Python code expression:

chr( ord( !FIELD_NAME![0] ) + 1)

Note: Be aware to change the default parser from vbScript to Python

The [0] after the attribute is intended to return only the 1st character of the input string, then, even if you have only a space after the 1st letter, you are sure that only one character is returned.

The ord function returns the integer corresponding to the given character in the character table. By incrementing that value by one, you get the integer value corresponding to the next character. Then you use the inverse function chr to get the character from the given integer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.