Sintaxe
M
Table.FuzzyNestedJoin(table1 as table, key1 as any, table2 as table, key2 as any, newColumnName as text, optional joinKind as nullable number, optional joinOptions as nullable record) as tableParâmetros
- table1tableObrigatório
Tabela à esquerda da junção.
MTable.FromRecords({...})- key1anyObrigatório
Coluna(s)-chave de
table1.M{"FirstName1"}- table2tableObrigatório
Tabela à direita da junção.
MTable.FromRecords({...})- key2anyObrigatório
Coluna(s)-chave de
table2.M{"FirstName2"}- newColumnNametextObrigatório
Nome da nova coluna com as linhas correspondentes.
M"NestedTable"- joinKindnullable numberOpcional
Tipo de junção (padrão
JoinKind.LeftOuter).MJoinKind.LeftOuter- joinOptionsnullable recordOpcional
Registro de opções que define como comparar as chaves.
M[IgnoreCase = true, IgnoreSpace = false]
Retorna
tableExemplo
M
Table.FuzzyNestedJoin(
Table.FromRecords(
{
[CustomerID = 1, FirstName1 = "Bob", Phone = "555-1234"],
[CustomerID = 2, FirstName1 = "Robert", Phone = "555-4567"]
},
type table [CustomerID = nullable number, FirstName1 = nullable text, Phone = nullable text]
),
{"FirstName1"},
Table.FromRecords(
{
[CustomerStateID = 1, FirstName2 = "Bob", State = "TX"],
[CustomerStateID = 2, FirstName2 = "bOB", State = "CA"]
},
type table [CustomerStateID = nullable number, FirstName2 = nullable text, State = nullable text]
),
{"FirstName2"},
"NestedTable",
JoinKind.LeftOuter,
[IgnoreCase = true, IgnoreSpace = false]
)Resultado
M
Table.FromRecords({
[
CustomerID = 1,
FirstName1 = "Bob",
Phone = "555-1234",
NestedTable = Table.FromRecords({
[
CustomerStateID = 1,
FirstName2 = "Bob",
State = "TX"
],
[
CustomerStateID = 2,
FirstName2 = "bOB",
State = "CA"
]
})
],
[
CustomerID = 2,
FirstName1 = "Robert",
Phone = "555-4567",
NestedTable = Table.FromRecords({})
]
})Mais informações
- Subgrupo
- Table