diff --git a/power-query/fReplaceFunction.m b/power-query/fReplaceFunction.m index 1613542..fff019d 100644 --- a/power-query/fReplaceFunction.m +++ b/power-query/fReplaceFunction.m @@ -6,15 +6,15 @@ let bIsWholeCell = if (bWholeCell = null) then true else bWholeCell, bIsTagged = not (sTag = null), - tSubstitution = if tSubstitution = null then - if bIsTagged then - try Table.SelectRows(fP("RENAMING_RULES"), each ([#"#"] = sTag)) otherwise fP("RENAMING_RULES") - else - fP("RENAMING_RULES") - else - tSubstitution, + tSubstitutionTable = if tSubstitution = null then + if bIsTagged then + try Table.SelectRows(fP("RENAMING_RULES"), each ([#"#"] = sTag)) otherwise fP("RENAMING_RULES") + else + fP("RENAMING_RULES") + else + tSubstitution, - tSubstBuffer = Table.Buffer(tSubstitution), + tSubstBuffer = Table.Buffer(tSubstitutionTable), ReplacedText = List.Accumulate(Table.ToRows(tSubstBuffer), sInputText, (state, substitution) => if bIsWholeCell then if (state = substitution{0}) then