Delen via


Table.FromPartitions

Syntaxis

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

Over

Retourneert een tabel die het resultaat is van het combineren van een set gepartitioneerde tabellen, partitions. partitionColumn is de naam van de kolom die u wilt toevoegen. Het type kolom wordt standaard ingesteld op any, maar kan worden opgegeven door partitionColumnType.

Voorbeeld 1

Itemtype zoeken in de lijst {number}.

Gebruik

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

uitvoer

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