[GIS] Calculate values in one field based on values in another field

arcgis-desktopfield-calculatorfields-attributes

I have one field with Zoning Codes (i.e.: RS) and I want to update another field with the string "Residential Single Family". The new field is currently NULL, I would like to add the full text string of the zoning codes. The field name containing the current code value is: [ZONING] and the new field is [ZONING_CLASS].

Best Answer

From an article below, I answered the question. The final code was:

https://stackoverflow.com/questions/8990864/calculating-subtypes-and-coded-values-in-arcgis-attribute-table

Pre-Logic Script Code:

Dim ValueToConvert
Dim ConvertedValue

ValueToConvert = [ZONING] 

Select Case ValueToConvert
Case "RS"
  ConvertedValue = "Single Family Residential"
Case "RSN"
  ConvertedValue = "Nodal Single Family Residential"
Case "R1S"
  ConvertedValue = "Retirement Community Single Family Residential"
Case "RM"
  ConvertedValue = "Medium Density Residential"
Case "RMN"
  ConvertedValue = "Nodal Medium Density Residential"
Case "CO"
  ConvertedValue = "Commercial Office"
Case "CG"
  ConvertedValue = "Commercial General"
Case "DDC"
  ConvertedValue = "Downtown Development & Conservation"
Case "MUV"
  ConvertedValue = "Mixed Use Village"
Case "IL"
  ConvertedValue = "Light Industrial"
Case "IP"
  ConvertedValue = "Industrial Park"
Case "P/SP"
  ConvertedValue = "Public and Semi-Public"
End Select

Output =ConvertedValue

ZONING_CLASS =

Output
Related Question