Join on multiple keys with EXTEND()
The EXTEND operation can add multiple fields to elements of an array of rows based on foreign key relationships.
This is the generalization of RELATED() for arrays of rows.
Syntax
EXTEND(
<array_of_rows>
WITH <feature> (, <feature>)*
VIA <field> (, <field>)* BOUND TO <feature> (, <feature>)*
) Where:
- Each
source_columnis a column containing values you want to copy - Each
aliasis the name for the added field in the output row array_of_rowsis a column containing arrays of rows with foreign keys that reference the primary keys in the source columns' tables
To be valid, <feature1>, <feature2>... need to be fully defined by the [... list of features] binding.
The examples on this page use data and features from the Datasets page, which will be created automatically if needed.
foreign keys ↔ primary key (join)
foreign keys ↔ foreign key (aggregation + join)
This capability is not yet available.
Relationship to RELATED()
The EXTEND() operation is the general-purpose mechanism for joining features across entities. The RELATED() function family provides a more concise and easier to understand syntax for simple cases.
Use RELATED() if possible, and EXTEND() when you need work with many foreign keys or require more explicit control over the binding logic.