如何将一个列的最近似值与Power BI的Power查询中的另一个表中的字符串列匹配?

发布于 2025-01-27 01:50:07 字数 430 浏览 3 评论 0原文

表1:

“在此处输入图像描述”

表2:

“在此处输入图像说明”

我尝试使用模糊匹配,但这并没有给我结果。

请帮忙!

Table 1:

enter image description here

Table 2:

enter image description here

Result:

enter image description here

I have tried using Fuzzy matching but it's not giving me the results.

Please help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

蓝咒 2025-02-03 01:50:07

之后

在创建table2:

let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
RelativeMerge = Table.AddColumn(Source, "RelativeJoin", 
        (x) => Text.Combine(Table.SelectRows(Table2, each Text.Contains(x[Column1],[Column1], Comparer.OrdinalIgnoreCase))[Column1],"::")),
y=List.Transform({1 .. List.Max(List.Transform(RelativeMerge[RelativeJoin], each List.Count(Text.Split(_,"::"))))}, each "match_"& Text.From(_)),
#"Split Column" = Table.SplitColumn(RelativeMerge, "RelativeJoin", Splitter.SplitTextByDelimiter("::", QuoteStyle.Csv), y)
in #"Split Column"

“在此处输入图像说明”

See if this works for you in powerquery

Find instances of items from Table2 within Table1

Code for Table1, after having created Table2:

let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
RelativeMerge = Table.AddColumn(Source, "RelativeJoin", 
        (x) => Text.Combine(Table.SelectRows(Table2, each Text.Contains(x[Column1],[Column1], Comparer.OrdinalIgnoreCase))[Column1],"::")),
y=List.Transform({1 .. List.Max(List.Transform(RelativeMerge[RelativeJoin], each List.Count(Text.Split(_,"::"))))}, each "match_"& Text.From(_)),
#"Split Column" = Table.SplitColumn(RelativeMerge, "RelativeJoin", Splitter.SplitTextByDelimiter("::", QuoteStyle.Csv), y)
in #"Split Column"

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文