|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
自定义函数去匹配,供参考;根本原理上来说还是“数据明细” 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"
复制代码
|
|