1

I have two columns labeled "Owner Address" and "City Address".

I'm trying to query the number of owners that live in the house they own to see how many rental units we have.

I can't figure out a way to select by attribute where Column A is equal to Column B.

1

There may be a way to do this with SQL if you have your data in SQL. However, to do this in ArcGIS you'll need to create a new attribute to hold 1 where Column A and B are equal and 0 if they are not equal.

  1. Add the new attribute field - I'm calling it OwnerTest
  2. Open the field calculator for the new field
  3. Use the following calculation to fill OwnerTest
  4. The records with matching column A and B will have 1 for OwnerTest. The records that don't match will have a 0.

Code Block:

def CompareColumns(columnA, columnB):
    if columnA == columnB:
        return 1
    else:
        return 0

Expression:

CompareColumns(!Column A!, !Column B!)

Parser type is Python.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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