我知道合并查询的方法,但是我实际应用中情况会复杂的多,合并查询不够,必须通过函数解决。我只是想知道 ...
自定义函数去匹配,供参考;根本原理上来说还是“数据明细” LEFT OUTER JOIN “引用表”的合并查询。
试了一下,合并查询的效率略高一些,约45s;写的函数合并近50s。
- let
Source = Excel.CurrentWorkbook(){[Name="数据明细"]}[Content],
#"Added Custom" = Table.AddColumn(
Source,
"Custom",
each [
RefTable = Table.Group(#"引用表", {"月份", "姓名"}, {{"AGGR", each _}}),
LookUp = RefTable{[月份=Date.StartOfMonth(_[日期]), 姓名=_[姓名]]}[AGGR]{0}
][LookUp]
),
#"Expanded Custom" = Table.ExpandRecordColumn(#"Added Custom", "Custom", {"其它1", "其它2", "其它3", "其它4"}, {"其它1", "其它2", "其它3", "其它4"})
in
#"Expanded Custom"
复制代码
10673102340134.zip
(451.12 KB, 下载次数: 0)
|