Join tables in model builder

07-29-2015 02:24 AM
New Contributor III


I am building a model to fetch tables with point data from a folder and make lines. Each file contains one week  of AIS (Automatic Identification System) data, i.e. shipping data.

The attribute table of the points contain the following fields


For making the lines I am using a publicly available script called TrackBuilder. The attribute table of the lines look like this:


The problem is that the field "shipType" is missing. I would like to modify the script (see attachment) to get that field in the lines attribute table.

I thought I could add a join to the model but I didn't succeed.


As you see above, the TrackBuilder script doesn't output a feature dataset that I can use to join it with the point table and get the "shipType".


Any ideas on how to modify the script or alternative solutions are welcome!

0 Kudos
5 Replies
MVP Legendary Contributor

You need a field in each table which contains a common identifier if you are trying to do an attribute join.

About joining and relating tables—Help | ArcGIS for Desktop

Alternately, are you wanting to a join by spatial location? Spatial Join—Help | ArcGIS for Desktop

New Contributor III

Thanks Dan,

yes, the join can be made with the mmsi field. I just want to make a attribute join, not spatial join.

The problem is that the result of the TrackBuilder script goes directly to the geodatabase. There is no output green "bubble"

0 Kudos
MVP Legendary Contributor

When you use the join 'bubble' you need to specify inputs...that is where you would specify the input fields from both files

0 Kudos
Occasional Contributor III

You'll need to use the Make Feature Layer tool against your target table (i.e. the table where you want to see the join). The Join tool's first input must be a layer type as joins and selections can only be applied to layer objects.

Make Feature Layer

Add Join

If you look at the Add Join tool you'll see that the first parameter is ​"in_layer_or_view".

New Contributor III

Yes, thanks,

that would solve the problem if the script "TrackBuilder" had an output with which I could do the join. But, as you see, nothing comes out of it. The result FC goes directly to the geodatabase


To me this seems to be an issue with that script, how to edit it so that it outputs something to make the join with?

I am trying an alternative solution here

0 Kudos