To join tables using multiple fields to create a unique sequence where an entity say a parcel can be unique identified according to more than one criteria as shown below. This could minimize data redundancy in tables and editing time
Here's a technique that might help in some cases:
If we want to edit a table while filtering based on a multi-field join to a table, we could use a subquery and EXISTS:
(in either a Definition Query or the Select By Attributes window)
exists ( select null from related_table where --this is the equivalent to a multi-field join:
main_table.event_id = related_table.event_id and main_table.year_ = related_table.year_ )
https://www.techonthenet.com/sql/exists.php
The downside is that the multi-field join via the subquery only filters the rows. We can't use it display columns in the Attribute Table from the related table.
Alternatively, if we want to display columns in the Attribute Table from the related table, we could create a database view that includes the data from both the main table and the related table. And do a multi-field join via SQL in the view.
And either use/view it as-is in ArcGIS (read-only). Or in ArcGIS, join it to original table and edit the table -- while being able to see the columns from the related table.
Please add the Joins based on multiple fields tool. It will be a tool where you will have the main table and the join table, each with the options to select primary, secondary, tertiary, and so on field options so that the primary field from the main table will match the primary field form the joint table and so on. This will eliminate the need to filter values prior to a join when multiple columns are needed.
A good example is when you have a main column with three categories, and a second column with subcategories, bot those subcategories can be repeated between main categories. Let say you have a main column with building names and a second column with apartment numbers. An apartment number 5B can exist in more than one building. But you want to update only apartment 5B from one specific building. That's where the Joins based on multiple fields tool will filter first the building names and second the apartment numbers.
Please add the Joins based on multiple fields tool. It will be a tool where you will have the main table and the join table, each with the options to select primary, secondary, tertiary, and so on field options so that the primary field from the main table will match the primary field form the joint table and so on. This will eliminate the need to filter values prior to a join when multiple columns are needed.
A good example is when you have a main column with three categories, and a second column with subcategories, bot those subcategories can be repeated between main categories. Let say you have a main column with building names and a second column with apartment numbers. An apartment number 5B can exist in more than one building. But you want to update only apartment 5B from one specific building. That's where the Joins based on multiple fields tool will filter first the building names and second the apartment numbers.
A last resort option might be to concatenate multiple join fields together into a single string. And then join on that one concatenated field rather than multiple fields.
But that's pretty messy. I my case, I wanted to concatenate a string and a date together in a file geodatabase view. But I couldn't get that to work using the CONCAT() FGDB function.
Related:
Good call on Make Query Table.
It's too bad it doesn't let us join on date fields. I wanted to join two file geodatabase tables on SPECIES=SPECIES and DATE=DATE. But I don't see my date fields in the Key Fields parameter picklist, so best guess is date fields are not supported for joins.
Make Query Table — Use date field in join
I need this as well. I'm considering creating a custom tool for it. I have a frequent need to join measurement records to a point feature class. The point features have siteid and genid. They are dual keyed. To join measurements, I have to do it with python currently. It would be great to be able to just specify more than one join field, similar to what can be done in a sql join statement. I like your idea @MiguelMartinezYordan .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.