Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I want to update a field in one table using two matching values in another table. Let's call the fields A, B and C in one table, and X, Y and Z in the other table. So, where A=X and B=Y then update C with Z

share|improve this question
1  
In what format is the data stored? What version of ArcGIS are you using? –  Vince Sep 17 '13 at 1:02
1  
Did you try using Field Calculator on a join between the tables? –  ujjwalesri Sep 17 '13 at 1:21

2 Answers 2

As stated, a table join will do what you are looking for. However if you want to be sure that A=X AND B=Y, then you will need to use a selection because joins may only be performed on a single field. So:

  1. Add Join on fields A and X. A and X must be the same data type. Also, you want to make sure that A/X B/Y combinations are unique, otherwise you might have undesirable results from the join (it will just pick the first record it finds, or generate summary statistics).
  2. Open the Attribute table, click select by attribute.
  3. Select where B=Y.
  4. Now use the field calculator on C, set the value to be Z.

The resulting calculation will only be performed on the selected data. You can now right click on your dataset, go to Joins and Relates, then to Remove Joins and "remove all" the joins.

Another method would be to add a new field to both tables, AB and XY, and construct a unique ID based on combinations of the two. Then you would do an "Inner Join" on field AB and XY.

share|improve this answer

As ujjwalesri already mentioned, you have to join the two tables. Right click on the first table (which contains the fields A, B, C) and then on Join and Relates. If your tables are part of a feature class or shapefile you have to click on the first layer. Afterwards click Join and the Join dialog will open. Of course you need a join field, to do the join. After joining the tables you can use the Field Calculator to transfer the field values.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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