Sintaxe
M
Table.NestedJoin(table1 as table, key1 as any, table2 as any, key2 as any, newColumnName as text, optional joinKind as nullable number, optional keyEqualityComparers as nullable list) as tableParâmetros
- table1tableObrigatório
Tabela da esquerda da junção.
MTable.FromRecords({[CustomerToCall = 1], [CustomerToCall = 3]})- key1anyObrigatório
Coluna(s)-chave de
table1.M{"CustomerToCall"}- table2anyObrigatório
Tabela da direita, cujas linhas correspondentes são aninhadas.
MTable.FromRecords({[CustomerID = 1, Name = "Bob", Phone = "123-4567"], ...})- key2anyObrigatório
Coluna(s)-chave de
table2.M{"CustomerID"}- newColumnNametextObrigatório
Nome da nova coluna que recebe as tabelas aninhadas.
M"CustomerDetails"- joinKindnullable numberOpcional
Tipo de junção a executar; o padrão é junção externa esquerda.
- keyEqualityComparersnullable listOpcional
Comparadores que definem como as colunas-chave são comparadas (uso interno).
Retorna
tableExemplo
M
Table.NestedJoin(
Table.FromRecords({
[CustomerToCall = 1],
[CustomerToCall = 3]
}),
{"CustomerToCall"},
Table.FromRecords({
[CustomerID = 1, Name = "Bob", Phone = "123-4567"],
[CustomerID = 2, Name = "Jim", Phone = "987-6543"],
[CustomerID = 3, Name = "Paul", Phone = "543-7890"],
[CustomerID = 4, Name = "Ringo", Phone = "232-1550"]
}),
{"CustomerID"},
"CustomerDetails"
)Resultado
M
Table.FromRecords({
[CustomerToCall = 1, CustomerDetails = Table.FromRecords({[CustomerID = 1, Name = "Bob", Phone = "123-4567"]})],
[CustomerToCall = 3, CustomerDetails = Table.FromRecords({[CustomerID = 3, Name = "Paul", Phone = "543-7890"]})]
})Mais informações
- Subgrupo
- Table