|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
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 |
|