Select to view content in your preferred language

Join Count attribute

319
4
03-04-2025 08:17 PM
BlakeMorrison
Frequent Contributor

I'm trying to automate a regular workflow via Data Pipelines. The current workflow I follow involves performing a spatial join, then filtering for join_count and performing different actions depending on the join count.

 

I might be misunderstanding something here, but I can only get a join count using one-to-one, and the attributes aren't actually joined together in the table - I only have the original feature attributes and an extra join count field.

 

If I perform a one-to-many join I can access the joined attributes, but I don't have a join count field to filter by.

 

Am I missing something here? Is there another way to achieve this workflow?

0 Kudos
4 Replies
DanPatterson
MVP Esteemed Contributor

Spatial Join (Analysis)—ArcGIS Pro | Documentation

When the Join Operation parameter is set to Join one to many, there can be more than one row in the output feature class for each target feature. Use the JOIN_FID field to determine which feature is joined to which target feature (TARGET_FID). A value of -1 for the JOIN_FID field means no feature meets the specified spatial relationship with the target feature.

Is as you describe.

since you now have multiple records for a location, are you trying to get a summary count?

Summary Statistics (Analysis)—ArcGIS Pro | Documentation


... sort of retired...
0 Kudos
BlakeMorrison
Frequent Contributor

@DanPatterson I'm sorry, I don't see a JOIN_FID field anywhere. I notice that the documentation you link is for ArcPro, whereas I'm trying to perform this operation in Data Pipelines within AGOL

If the join_count is 0 I would like to take no action.
If the join_count is 1 I would like to perform further attribute checks before branching out into other operations depending on the checks.

If the join_count is greater than 1 I would like to return a list of those features for manual review.

0 Kudos
BlakeMorrison
Frequent Contributor
0 Kudos
MaxPayson
Esri Contributor

Hi @BlakeMorrison, one-to-one joins create summarized values for all "Join" dataset records that match a single "Target" dataset record, so it doesn't return the "Join" attribute values themselves. By default, the only summary statistic is the count, but more can be added with the "Summary fields" parameter. Then one-to-many joins create a new record for each matching "Join" dataset record, but they don't summarize so they don't include the count.

A couple ideas to accomplish what you described:

  1. For the 0 match case, use "One to many" and "Left join", then use the Filter by attribute tool to filter to the records where the joined fields are empty (no match) or where they are not empty (match)
  2. For the generic case, add a "One to one" join to create the count, then add a "One to many" join with the original dataset and "One to one" output as inputs. This should add the count back to the original records

Let us know if this helps! And thank you for the question

0 Kudos