excel - VLOOK Excel 结果与 Power Query 合并不匹配
问题描述
- 我创建了 Power 查询以使用合并对两个表执行 VLOOK。
- 当我使用 Full Outer 合并它们时,结果与 VLOOKUP Excel 不同。
似乎 Excel VLOOKUP 公式采用第一个匹配实例并且没有更进一步。
Table2
Apple 2 fruit
Grapes 14 fruit
Grapes 15 fruit
Grapes 16 fruit
Banana 22 fruit
Banana 23 fruit
Banana 24 fruit
Banana 25 fruit
Table1
prod sno (VLOOKUP)
Apple 1
Grapes 14
Grapes 14
Banana 22
Banana 22
=VLOOKUP(A2,Table2[#All],2,FALSE)
let
Source = Table.NestedJoin(Table4, {"prod"}, Table2, {"prod"}, "Table2", JoinKind.LeftOuter),
#"Expanded Table2" = Table.ExpandTableColumn(Source, "Table2", {"snum"}, {"Table2.snum"})
in
#"Expanded Table2"
RESULT FROM PQ FOR VLOOKUP
prod Table2.snum
Apple 1
Apple 2
Grapes 14
Grapes 15
Grapes 16
Grapes 14
Grapes 15
Grapes 16
Banana 22
Banana 22
Banana 23
Banana 23
Banana 24
Banana 24
Banana 25
Banana 25
解决方案
删除您已在使用的展开步骤。假设 XXX 是合并步骤中的列名,添加添加列...自定义列...与公式
= Table.FirstN([XXX],1)
然后右键单击列 XXX 并将其删除。而是展开新列
这只会从合并中获取一个结果,即第一行
推荐阅读
- javascript - 如何在 package.json 的 npm 脚本中使用 SECRET_ENV?
- javascript - 如何从我的 express 应用程序获取数据到我的前端组件(在 React 中)?
- vb.net - 示例数据表绑定到 gridview 在 vs2019-2017 中不起作用
- javascript - 如何正确清除超时
- css - “Gotham Bold”字体系列在 Safari 浏览器中不起作用
- amazon-web-services - AWS API Gateway 集成请求 Http 标头未传递给 lambda
- javascript - 无法使用 Patches.get 值来编写 spark AR 脚本
- android - 使用 Tensorflow 在 Android 上实现离线连续语音识别器的最有效方法是什么?
- java - 在扫描仪行中直接添加用户输入的数字而不是下面的行?
- c# - 每次我使用多个表时序列化类型对象时检测到循环引用