Forum Discussion
Help with Implementing Reiteration for Conditional Replacement of Values through "Coupled" Columns
- 8 months ago
let replacer = (text01, text02) => Text.Replace(text01 ?? "", text02 ?? "", ""), fxr = (lst) => ( (data) => {lst{0}} & List.Transform(List.Zip(data), (x) => replacer(x{0}, x{1})) & data{1} )(List.Split(List.Skip(lst), (List.Count(lst) - 1) / 2)), Source = Excel.CurrentWorkbook(){[Name="Table4"]}[Content], ttl = Table.ToList(Source, fxr), result = #table(Value.Type(Source), ttl) in result
Hi isg
Following up to confirm if the earlier responses addressed your query. If not, please share your questions and we’ll assist further...
Hi v-aatheeque ,
Yes! Sorry for the belated response. I was able to successfully implement all three solutions in my file. The only last step for me to do is to run all three of them and compare the runtime duration. Once that is done and I have the fastest code, will put it as the accepted solution. Planning to do this tomorrow afternoon.
Thanks for checking in again. Apologies, I know this topic has been open for a while.
EDIT 12/22: v-aatheeque Unfortunately, I did not get the chance to compare the run times for the three queries this past Friday. I will have to provide an update next week as I won't be able to run the queries during the holiday break. Sorry again for the much delayed results.