0

I'd like to assign a new name (either HIGH, MEDIUM or LOW) to values selected from different columns in ArcMap 10.3

I selected the two values from the two columns ("MAIN_ROCK" and "SUB_ROCKS") using SELECT BY ATTRIBUTES as follows:

"MAIN_ROCK"='gravel" AND "SUB_ROCKS" in ('mudstone tephra loess','sand mud','sand mud peat','sandstone mudstone tephra silt lignite','sandstone siltstone mudstone limestone silt lignite')

I want these highlighted main and sub rocks to be called "HIGH" in new column. So, I created another text field and named it CATEGORY.

enter image description here

I used field calculator while these main and sub-rocks are highlighted and wrote 'HIGH' in the field calculator of CATEGORY column but I got the message below

enter image description here

Any idea how can I do this?

6
  • 3
    remember to quote your string i.e "HIGH" or the dialog will think you're looking for a field named HIGH. What parser are you using? (VB, python or python 9.3) Sep 11, 2015 at 2:07
  • 2
    In a question about the Field Calculator it is important to always include the precise syntax that you supplied to it within your question. Remember that errors should always be posted as text in preference to pictures. What did the Main Menu | Geoprocessing > Results window (as indicated in the error message) report?
    – PolyGeo
    Sep 11, 2015 at 2:11
  • @MichaelMiles-Stimson I'm using VB
    – shiny
    Sep 11, 2015 at 2:31
  • 1
    for VB use "HIGH" to populate the field with the string, either HIGH or [HIGH] means to populate the field with the values in the field called HIGH. As this field probably doesn't exist it will give you a vague error which really means 'field not found'. In python fields are specified like !HIGH! where HIGH means 'the value in the variable or procedure HIGH', meant for the advanced field calculator, and "HIGH" (and possibly 'HIGH', though I haven't tried it) means the string. Hope that clears it up for you. Sep 11, 2015 at 2:38
  • 1
    @MichaelMiles-Stimson I was using 'HIGH' instead of using "HIGH". It is working perfect now using "HIGH" thanks to you. Could you please write it as answer not as a comment? :-)
    – shiny
    Sep 11, 2015 at 2:44

1 Answer 1

3

With the field calculator there are a few special things to be aware of..

When using the VBA field parser (the default) how you present words affects their meaning:

  • "HIGH" means the string, each of the rows will be populated with this string.
  • HIGH or [HIGH] means the values contained in the field called HIGH (not case sensitive).

When using the new & improved python parser:

  • "HIGH" (and possibly 'HIGH', but I haven't tested this) means the string, each of the rows will be populated with this string.
  • !HIGH! means the values contained in the field called HIGH (not case sensitive).
  • HIGH means the value contained in the variable or function HIGH (case sensitive), this is intended for the advanced field calculator.

Another special word that isn't listed anywhere easy to find is NULL (VB, not case sensitive) or None (python, case sensitive) will populate the field with Null (unpopulate). This only counts for data storage that can accept null values.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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