Condividi tramite


Table.FromPartitions

Sintassi

Table.FromPartitions(
    partitionColumn as text,
    partitions as list,
    optional partitionColumnType as nullable type
) as table

Informazioni su

Restituisce una tabella che rappresenta il risultato della combinazione di un set di tabelle partizionate, partitions. partitionColumn è il nome della colonna da aggiungere. Il tipo predefinito di colonna è any, ma può essere specificato da partitionColumnType.

Esempio 1

Trovare il tipo di elemento dall'elenco {number}.

Utilizzo

Table.FromPartitions(
    "Year",
    {
        {
            1994,
            Table.FromPartitions(
                "Month",
                {
                    {
                        "Jan",
                        Table.FromPartitions(
                            "Day",
                            {
                                {1, #table({"Foo"}, {{"Bar"}})},
                                {2, #table({"Foo"}, {{"Bar"}})}
                            }
                        )
                    },
                    {
                        "Feb",
                        Table.FromPartitions(
                            "Day",
                            {
                                {3, #table({"Foo"}, {{"Bar"}})},
                                {4, #table({"Foo"}, {{"Bar"}})}
                            }
                        )
                    }
                }
            )
        }
    }
)

Output

Table.FromRecords({
    [
        Foo = "Bar",
        Day = 1,
        Month = "Jan",
        Year = 1994
    ],
    [
        Foo = "Bar",
        Day = 2,
        Month = "Jan",
        Year = 1994
    ],
    [
        Foo = "Bar",
        Day = 3,
        Month = "Feb",
        Year = 1994
    ],
    [
        Foo = "Bar",
        Day = 4,
        Month = "Feb",
        Year = 1994
    ]
})