Select to view content in your preferred language

calculating fields in model builder

847
1
04-19-2011 12:33 PM
DavidManz
New Contributor
I have what is probably a bonehead question for everyone else.  How can I calculate the value of field X to 100 but only if the value of field y=A.  I can do this easily enough in arcmap but I want to make a model that will do this.  Can anyone help?
0 Kudos
1 Reply
MaudGillespie
Deactivated User
Without going into too much detail; you would use the calculate field tool and, in the expression field, click on the calculate expression icon and insert a code block similar to this:

dim FieldName
dim ExpValue

FieldName = "y"
if "FieldName" = "A" then
  ExpValue = "100"
end if

For further information, search the help files for using code blocks.

Good Luck,

Frank
0 Kudos