|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
let
源 = Excel.CurrentWorkbook(){[Name="表1"]}[Content],
更改的类型 = Table.TransformColumnTypes(源,{{"日期", type date}, {"班号", Int64.Type}, {"离港", type text}, {"起飞", type datetime}, {"到港", type text}, {"落地", type datetime}, {"工号", Int64.Type}, {"名字", type text}, {"北京出发标记", type any}, {"上海出发标记", type any}}),
自定义1 = List.Transform(Table.ToRecords(更改的类型),(x)=>Record.TransformFields(x,{{"北京出发标记",each if x[起飞] = List.Min(Table.SelectRows(更改的类型, each ([日期] = x[日期]))[起飞]) and x[离港]="北京" then 1 else null},{"上海出发标记",each if x[起飞] = List.Min(Table.SelectRows(更改的类型, each ([日期] = x[日期]))[起飞]) and x[离港]="上海" then 1 else null}})),
自定义2 = Table.FromRecords(自定义1,Table.ColumnNames(源))
in
自定义2 |
|