Forum Discussion
XLOOKUP Not Finding Associated Value After Cleaning Up Data With Power Query
All the hard work by SergeiBaklan, just posting a couple of alternatives for the UTF replacement (in attached file)
// Variant1
ReplacedUtf = Table.ReplaceValue( Source, each [LinkURL], null,
(old_value, current_value, replacer) as text =>
if current_value is null then old_value else
List.Accumulate( ListReplacmentsTexts, current_value,
(value,lists) => Text.Replace( value , lists{0}, lists{1} )
),
{"LinkURL"}
)
// Variant2
ReplacedUtf = Table.ReplaceValue( Source,
each if [LinkURL] is null then false else [LinkURL],
each List.Accumulate( ListReplacmentsTexts, [LinkURL],
(current_value,lists) => Text.Replace( current_value , lists{0}, lists{1} )
),
Replacer.ReplaceText,
{"LinkURL"}
)
- renee_crozierNov 07, 2024Brass Contributor
Thank you for these variants! Since I'm using these replacements on all workbooks, I decided to use it as a separate workbook and add it as a query. I modified your code to match what I'm working with but I'm having issues targeting the LinkURL column. I get an error:
I've tried modifying your code to say "Column19" since it falls before the promoted header step and I tried adjusting the "Source" after ReplaceValue and I don't get the error but the URLs aren't fixed.
For reference, this is the Encoding Reference query. The custom column is just a list of lists. I was trying another method to replace all of the UTF-8 characters.
Any ideas?