Table.FromPartitions
語法
Table.FromPartitions(partitionColumn as text, partitions as list, optional partitionColumnType as nullable type) as table
關於
傳回資料表,其為結合一組已分割資料表 partitions
的結果。
partitionColumn
為要新增的資料行名稱。 資料行類型預設為 any
,但可由 partitionColumnType
指定。
範例 1
從清單 {number}
中尋找項目類型。
使用方式
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"}})}
}
)
}
}
)
}
}
)
輸出
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
]
})