Table.AddJoinColumnTable.AddJoinColumn

SintaxeSyntax

Table.AddJoinColumn(table1 as table, key1 as any, table2 as function, key2 as any, newColumnName as text) as table  

SobreAbout

Une as linhas de table1 com as linhas de table2 com base na igualdade dos valores das colunas de chave selecionadas por key1 (para table1) e key2 (para table2).Joins the rows of table1 with the rows of table2 based on the equality of the values of the key columns selected by key1 (for table1) and key2 (for table2). Os resultados são inseridos na coluna chamada newColumnName.The results are entered into the column named newColumnName. Essa função se comporta de forma semelhante à Table.Join com um JoinKind de LeftOuter, exceto que os resultados da junção são apresentados em um modo aninhado, e não nivelado.This function behaves similarly to Table.Join with a JoinKind of LeftOuter except that the join results are presented in a nested rather than flattened fashion.

Exemplo 1Example 1

Adicione uma coluna de junção a ({[saleID = 1, item = "Shirt"], [saleID = 2, item = "Hat"]}) denominada "preço/estoque" da tabela ({[saleID = 1, price = 20], [saleID = 2, price = 10]}) associada em [saleID].Add a join column to ({[saleID = 1, item = "Shirt"], [saleID = 2, item = "Hat"]}) named "price/stock" from the table ({[saleID = 1, price = 20], [saleID = 2, price = 10]}) joined on [saleID].

Table.AddJoinColumn(
    Table.FromRecords({
        [saleID = 1, item = "Shirt"],
        [saleID = 2, item = "Hat"]
    }),
    "saleID",
    () => Table.FromRecords({
        [saleID = 1, price = 20, stock = 1234],
        [saleID = 2, price = 10, stock = 5643]
    }),
    "saleID",
    "price"
)
saleIDsaleID itemitem preçoprice
11 CamisetaShirt [Tabela][Table]
22 HatHat [Tabela][Table]