Compartilhar via


Table.FromPartitions

Sintaxe

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

Sobre

Retorna uma tabela que é o resultado da combinação de um conjunto de tabelas particionadas, partitions. partitionColumn é o nome da coluna a ser adicionada. O tipo da coluna é padronizado para any, mas pode ser especificado por partitionColumnType.

Exemplo 1

Encontre o tipo de item na lista {number}.

Usage

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"}})}
                            }
                        )
                    }
                }
            )
        }
    }
)

Saída

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
    ]
})