Table.AddColumn

您所在的位置:网站首页 powerquery读音 Table.AddColumn

Table.AddColumn

2024-02-21 11:28| 来源: 网络整理| 查看: 265

Table.AddColumn 项目 01/17/2024 语法 Table.AddColumn(table as table, newColumnName as text, columnGenerator as function, optional columnType as nullable type) as table 关于

将名为 newColumnName 的列添加到表 table。 使用指定的选择函数 columnGenerator(它将每行作为输入)来计算列的值。

示例 1

将名为“TotalPrice”的数字列添加到表中,每个值是 [Price] 和 [Shipping] 列的总和。

使用情况

Table.AddColumn( Table.FromRecords({ [OrderID = 1, CustomerID = 1, Item = "Fishing rod", Price = 100.0, Shipping = 10.00], [OrderID = 2, CustomerID = 1, Item = "1 lb. worms", Price = 5.0, Shipping = 15.00], [OrderID = 3, CustomerID = 2, Item = "Fishing net", Price = 25.0, Shipping = 10.00] }), "TotalPrice", each [Price] + [Shipping], type number )

输出

Table.FromRecords({ [OrderID = 1, CustomerID = 1, Item = "Fishing rod", Price = 100, Shipping = 10, TotalPrice = 110], [OrderID = 2, CustomerID = 1, Item = "1 lb. worms", Price = 5, Shipping = 15, TotalPrice = 20], [OrderID = 3, CustomerID = 2, Item = "Fishing net", Price = 25, Shipping = 10, TotalPrice = 35] })


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3