Teilen über


Table.FromPartitions

Syntax

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

About

Gibt eine Tabelle zurück, die das Ergebnis der Kombination einer Gruppe von partitionierten Tabellen ist. partitions partitionColumn ist der Name der hinzuzufügenden Spalte. Der Typ der Spalte ist standardmäßig anyauf , kann jedoch durch partitionColumnTypeangegeben werden.

Beispiel 1

Elementtyp aus der Liste {number}suchen.

Verwendung

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