Concatenate key fields
If a single key field is insufficiently unique to accurately relate two tables, you can create a computed field in each table that concatenates two or more key fields, and relate the tables using the computed fields.
You can also use this method when joining tables, but there is no requirement that you do so because joining allows you to select more than one key field per table.
As with single key fields, concatenated key fields must have an identical data structure and data format in the two tables being related.
Note
You can concatenate only character key fields, so you may have to use Analytics functions to convert non-character data prior to concatenating. For more information, see Harmonizing fields.
- Open the parent table and select .
- Click Add a New Expression .
- Enter a Name for the concatenated key field.
- Click f(x) to open the Expression Builder.
- Build an expression using two or more key fields and
the Add operator (+).
For example: vendor_ID + location_code
- Click OK.
If you get an “Expression type mismatch” error, one or more of the key fields are probably not character key fields.
- Click Accept Entry and click Close to exit the Table Layout dialog box.
- Open the child table and repeat the same steps to add an identical concatenated key field to the child table.
- Relate the two tables using the concatenated key field.