Select to view content in your preferred language

relate in model builder

1697
1
03-06-2017 08:13 AM
JoanneHalls
New Contributor

I have a one-to-many relationship and would like to iterate through each record in the table, select the records in the related table, query to find if a specific value, then calculate field1 in the iterate table, if another value then calculate field2 in iterate table.  I am trying to add the values from a one-to-many relate to the source table so that I can get ride of the relate. 

0 Kudos
1 Reply
curtvprice
MVP Alum

A common approach to convert a one to many to relate to one to one is to summarize the related table by the key. The Summary Statistics tool can give you a table unique by your key, which you can then join up one-to-one.

Another approach to consider would be to take your "many" table and join back to the source ("many to one"), you could then use a arcpy.da.SearchCursor in a little function embedded in the Calculate Value tool to do your work.

I hope this is some help.