问题:
以A3为例,茶几点30%,即2099.7元; 沙发占70%,即4899.3元
以此类推
let
源 = Excel.CurrentWorkbook(){[Name="表1"]}[Content],
按分隔符拆分列 = Table.ExpandListColumn(Table.TransformColumns(源, {"比例", Splitter.SplitTextByDelimiter(":"), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}), "比例"),
插入的乘法 = Table.AddColumn(按分隔符拆分列, "比例价", each [销售价] * Number.From([比例]) / 10),
分组的行 = Table.Group(插入的乘法, {"品名"}, {"计数", each Table.AddIndexColumn(_,"索引")}),
展开组 = Table.ExpandTableColumn(分组的行, "计数", {"比例价", "索引"}),
品名拆分 = Table.TransformColumns(展开组, {"品名", each Text.Split(_,"、")}),
已添加自定义 = Table.AddColumn(品名拆分, "单一品名", each List.Range([品名],[索引],1)),
展开品名 = Table.ExpandListColumn(已添加自定义, "单一品名"),
删除的其他列 = Table.SelectColumns(展开品名,{"单一品名", "比例价"}),
更改的类型 = Table.TransformColumnTypes(删除的其他列,{{"单一品名", type text}, {"比例价", type number}})
in
更改的类型
标签:品名,比例,拆分,each,Table,type From: https://www.cnblogs.com/officeplayer/p/16794793.html