Forum Discussion
Anonymous
5 years agoNot applicable
Correct misspelled words in Power Query
How do I clean the data like the figure below? I didn't find a similar function in the PQ interface. Thanks!
- 5 years ago
Hi, Anonymous ,
You can use Table.AddFuzzyClusterColumn() ,
Daniil has a great blog post for that.
Best.
Mark this post as solution if this helps.
CNENFRNL
5 years agoCommunity Champion
Hi, Anonymous , you might want to try the following code,
let
typo = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCk/NycxLL8nPU4rVAfOg3GIUfiZCOh9FNYwXCwA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [City = _t]),
misspelling = Table.FromList({"Welington City","CityWellingtons","City Wellingtin 443","Nr. 22 WellongtonCity"}, Splitter.SplitByNothing(), {"Addr"}),
#"Added Custom" = Table.AddColumn(misspelling, "Custom", each
List.Accumulate(
typo[City], _[Addr], (s, c) => Text.Replace(s, c, "Wellington")
)
)
in
#"Added Custom"