Select to view content in your preferred language

Add Join — Create independent definition query on join table (pre-filter)

379
3
02-22-2024 08:26 AM
Status: Open
Labels (1)
Bud
by
Esteemed Contributor

ArcGIS Pro 3.2.2; File Geodatabase


When joining to a table that has a definition query, the definition query gets applied to the input table (and to the join table). The definition query effectively becomes an inner join, even if "Keep all input records" was checked in the join.

That ends up being a gotcha in a lot of cases.

Users would expect the definition query to be applied as a "pre-filter" to the join table only, instead of applying the definition query to the resulting joined tables.

Could that behaviour be changed so that the definition query on the join table remains independent (as a pre-filter)?

Maybe something like this:

Bud_2-1708619125879.png

Related:

3 Comments
Bud
by

If the join table has a definition query, the Keep all input records parameter will have no effect. Manually updating the definition query by appending or OBJECTID is null can fix this if appropriate.

https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/add-join.htm 

Bud
by

As a workaround:

We can try hiding/embedding the SQL expression using Make Query Table. The SQL expression behaves like a pre-filter, applied before the join is performed, which is what we want, unlike definition queries. https://community.esri.com/t5/arcgis-pro-ideas/consistent-visible-sql-expressions-and-query/idc-p/13... But we have to be careful not to forget about that SQL expression because it isn't visible or modifiable anywhere. I find it helps to describe the SQL expression in the layer's name.