Table.AggregateTableColumn

構文

Table.AggregateTableColumn(table as table, column as text, aggregations as list) as table

バージョン情報

table[column] 内のテーブルを、テーブルの集計値を含む複数の列に集計します。 aggregations を使用して、集計するテーブルを含む列、値を生成するためにテーブルに適用する集計関数、および作成する集計列の名前を指定します。

例 1

テーブル {[t = {[a=1, b=2, c=3], [a=2,b=4,c=6]}, b = 2]} 内の [t] のテーブル列を、[t.a] の合計、[t.b] の最小値と最大値、および [t.a] 内の値の数に集計します。

使用方法

Table.AggregateTableColumn(
    Table.FromRecords(
        {
            [
                t = Table.FromRecords({
                    [a = 1, b = 2, c = 3],
                    [a = 2, b = 4, c = 6]
                }),
                b = 2
            ]
        },
        type table [t = table [a = number, b = number, c = number], b = number]
    ),
    "t",
    {
        {"a", List.Sum, "sum of t.a"},
        {"b", List.Min, "min of t.b"},
        {"b", List.Max, "max of t.b"},
        {"a", List.Count, "count of t.a"}
    }
)

出力

Table.FromRecords({[#"sum of t.a" = 3, #"min of t.b" = 2, #"max of t.b" = 4, #"count of t.a" = 2, b = 2]})