英文:
Power Query Remove Values with specific values in the string
问题
I am trying to remove the value of the person's surname if the string contains any of the following values "Ltd","Limited","LLP","T/A","Plc".
The code I have built turns all of the surnames into errors, and I am struggling to understand why. Any assistance would be greatly appreciated.
= Table.TransformColumns(
"Move Company Names to New Column",
{{"Person Surname",
each if Text.Length(_) > 20 or
List.MatchesAny({"Ltd","Limited","LLP","T/A","Plc"}, (s)=> Text.Contains([Person Surname], s, Comparer.OrdinalIgnoreCase)) then null
else _}})
英文:
I am trying to remove the value of the person's surname if the string contains and of the following values "Ltd","Limited","LLP","T/A","Plc"
.
The code I have built so turns all of the surnames into errors and I am struggling to understand why. Any assistance would be greatly appreciated.
= Table.TransformColumns(
#"Move Company Names to New Column",
{{"Person Surname",
each if Text.Length(_) > 20 or
List.MatchesAny({"Ltd","Limited","LLP","T/A","Plc"}, (s)=> Text.Contains([Person Surname], s, Comparer.OrdinalIgnoreCase)) then null
else _}})
答案1
得分: 2
= Table.TransformColumns(
#"Move Company Names to New Column",
{{"Person Surname",
每个人如果Text.Length() > 20或
List.MatchesAny({"Ltd","Limited","LLP","T/A","Plc"}, (s)=> Text.Contains(, s, Comparer.OrdinalIgnoreCase))则为null
否则_}})
英文:
= Table.TransformColumns(
#"Move Company Names to New Column",
{{"Person Surname",
each if Text.Length(_) > 20 or
List.MatchesAny({"Ltd","Limited","LLP","T/A","Plc"}, (s)=> Text.Contains(_, s, Comparer.OrdinalIgnoreCase)) then null
else _}})
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论