|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
let
源 = Excel.CurrentWorkbook(){[Name="表1"]}[Content],
数据表 = [a=List.Transform(源[2017年9月汽车销售榜],each Text.Split(_,",")),b=Table.PromoteHeaders(Table.FromRows(a)),c=Table.SplitColumn(b,"官方价 ",each Text.Split(Text.Replace(_,"万",""),"-"),{"最低价","最高价"})][c],
系列分组 = Table.Group(数据表,"系列 ",{{"最低价",each List.Min(List.Transform([最低价], each try Number.From(_) otherwise null))},{"最高价",each List.Max(List.Transform([最高价], each try Number.From(_) otherwise null))},{"总销量",each List.Sum(List.Transform([9月销量], each try Number.From(_) otherwise null))}}),
品牌分组 = Table.Group(数据表,"从属品牌 ",{{"车型数量",each Table.RowCount(_)},{"总销量",each List.Sum(List.Transform([9月销量], each try Number.From(_) otherwise null))},{"最低价",each List.Min(List.Transform([最低价], each try Number.From(_) otherwise null))},{"最高价",each List.Max(List.Transform([最高价], each try Number.From(_) otherwise null))}})
in
品牌分组
|
|