3

I'm new to GIS in general and field calculator in particular.

I have a basic attribute table with three columns. I'd like to assign values to column C based on what is in column A. If Column A = 8 then I need column C to read "pine forest". Column C is set for text with length=100 so that should not be a problem.

I had thought I could do this by selecting all of the records where column A = 8 and then using field calculator in column C to assign them the label "pine forest". However this results in an error message saying that the calculated value is invalid because it is either too large or because it is a string, which are both wrong.

closed as unclear what you're asking by PolyGeo, Aaron, Jason Scheirer, whuber Jan 14 '14 at 22:25

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    If you want to assign a string, make sure your column is defined as text – HDunn Jan 14 '14 at 20:40
  • Thanks, it is defined as text though. – Cally Jan 14 '14 at 20:48
  • 4
    Are you enclosing "pine forest" in quotes? – kenbuja Jan 14 '14 at 20:51
  • 1
    it might be helpful to post a sample of your table, or a screen capture of the field calculator for people to see if there is a syntax problem – TDavis Jan 14 '14 at 20:54
  • 1
    Show your exact field calculator syntax in case you are missing something small in the expression – user681 Jan 14 '14 at 20:55
2

If you are encountering this error:

enter image description here

You need to enclose your new text in quotes:

enter image description here

1

Try switching to Python parser and using single quotes. Generally, I find Python much more stable while doing field calculations.

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