Table.ExpandListColumn

Sintassi

Table.ExpandListColumn(table as table, column as text) as table

Informazioni su

Dato table, dove column contiene un elenco di valori, divide l'elenco in una riga per ogni valore. I valori delle altre colonne vengono duplicati in ogni nuova riga creata. Questa funzione può anche espandere le tabelle annidate trattandole come elenchi di record.

Esempio 1

Dividere la colonna dell'elenco [Name].

Utilizzo

Table.ExpandListColumn(
    Table.FromRecords({[Name = {"Bob", "Jim", "Paul"}, Discount = .15]}),
    "Name"
)

Output

Table.FromRecords({
    [Name = "Bob", Discount = 0.15],
    [Name = "Jim", Discount = 0.15],
    [Name = "Paul", Discount = 0.15]
})

Esempio 2

Dividere la colonna della tabella annidata [Components].

Utilizzo

Table.ExpandListColumn(
    #table(
        {"Part", "Components"},
        {
            {"Tool", #table({"Name", "Quantity"}, {{"Thingamajig", 2}, {"Widget", 3}})}
        }
    ),
    "Components"
)

Output

Table.FromRecords({
    [Part = "Tool", Components = [Name = "Thingamajig", Quantity = 2]],
    [Part = "Tool", Components = [Name = "Widget", Quantity = 3]]
})