Joins based on multiple fields

387
3
06-15-2023 08:18 AM
Status: Open
Labels (1)
MiguelMartinezYordan
Occasional Contributor

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.

Tags (3)
3 Comments
DougGreen

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. Do 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 .

Bud
by

A duplicate idea with the same name: Joins based on multiple fields

And Relate using multiple fields

Bud
by

As a last resort, you could create a COMPOSITE_ID field. Populate via an attribute rule by concatenating the apartment number and building name together into a single text field. Do that in both tables. Create a single-field join using Add Join on the COMPOSITE_ID fields.