1

As the title may imply I want to keep the maximum value in field2 for several identical IDs in field1, the others are deleted for example this table:

Field1  Field2
14772   1
14772   4
14766   3
14766   1
14766   1
14766   1
14766   1
14765   1
14765   3
14765   1

becomes:

Field1  Field2
14772   4
14766   3
14765   3

by deleting all the duplicate ID (field1) with lower value in field2. for your information my final objective is to join the table with another using field1, I only want rows with highest field2 value to be joined.

I'm using Arcmap 10.1

2
  • What should happen if the Field2 has is tied for the highest value with an identical Field1 value?
    – Eok
    Jun 24 '15 at 18:51
  • keep both or delete one of them, one of them should make it through the join process at the end
    – Solaire
    Jun 24 '15 at 18:52
2

Use Summary Statistics with the first field being the case field and use the maximum of field 2.

arcpy.analysis.Statistics(in_tab, out_tab, [['Field2', 'MAX']], 'Field1')

0

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.