how to combine two attribute table in acgis through model builder?

1834
5
01-26-2016 09:30 AM
Highlighted
New Contributor III

I am working with two attribute tables shown below. I want to join Centroid_Sites_Fbr (objectID) to Centroid_Sites_Fiber (In_FID). As you can see Centroid_Sites_Fiber contains multiple values for some records. I want to join these two tables where output should have all 15 ObjectId plus the multiple data from Centroid_Sites_Fiber table. Any help is appreciated.

Thanks

MG

Tags (3)
Reply
0 Kudos
5 Replies
Highlighted
Occasional Contributor II

Joins only work with a 1 - 1 relationship in ArcGIS. You can use a Relate to match up a 1 - Many relationship like this, though your data won't appear all in the same table like you want. You'll have to select an individual feature and view related records for that one feature.

Other options -

  • It's also possible you could view the table and related records using a report.
  • Summarize the child table (on the right) so that there is only 1 item per FBR record.
  • Export the data into a true relational database, though you'll probably loose the spatial component.
  • Use a python script to add related data to a map layout text box.
Highlighted
Regular Contributor III

If the tables are stored in a geodatabase you could use Make Query Table—Help | ArcGIS for Desktop

Highlighted
Occasional Contributor III

I'm not sure how you would do this through model builder. You could add the fields you want to populate in your Centroid_Sites_Fbr  and use python to set up a search cursor​ on Centroid_Sites_Fiber and set up an update cursor​ for Centroid_Sites_Fbr to populate the fields according to the OID@. If that is something you are interested in I'm sure we could set up the code really quick to help you along.

Highlighted
New Contributor III

Hi Luke,

That will be great if I can get the python script which will update the table with all the rows from the second table.

Thanks

MG

Sent from my iPhone

Reply
0 Kudos
Highlighted
Occasional Contributor III

Sure. It would definitely help to know what your attribute fields are that you are trying to update. If you could either send a sample dataset of Centroid_Sites_Fbr   and Centroid_Sites_Fiber or at least provide a screen shot of the full attribute tables that would help us get started. Thanks.