ruthhacche
Board Regular
- Joined
- Sep 22, 2017
- Messages
- 84
I have this tedious list of code that is about to get longer. It was created using Transform/replace values on the ribbon rather than writing from scratch. I am sure you should not write it like this from scratch but I cannot work out the syntax to do all the replacements in these two columns in just one bit of code.
#"Replaced Value1" = Table.ReplaceValue(#"Clean Names","GAF ","",Replacer.ReplaceText,{"ITEM Name Short","ITEM ProductName"}),
#"Replaced Value2" = Table.ReplaceValue(#"Replaced Value1","BKC ","",Replacer.ReplaceText,{"ITEM Name Short","ITEM ProductName"}),
#"Replaced Value3" = Table.ReplaceValue(#"Replaced Value2","PZA ","",Replacer.ReplaceText,{"ITEM Name Short","ITEM ProductName"}),
#"Replaced Value4" = Table.ReplaceValue(#"Replaced Value3","PZC ","",Replacer.ReplaceText,{"ITEM Name Short","ITEM ProductName"}),
#"Replaced Value5" = Table.ReplaceValue(#"Replaced Value4","BKA ","",Replacer.ReplaceText,{"ITEM Name Short","ITEM ProductName"}),
#"Replaced Value6" = Table.ReplaceValue(#"Replaced Value5","GFT ","",Replacer.ReplaceText,{"ITEM Name Short","ITEM ProductName"}),
I guess also there is a way to do this using a separate table of replacement names - can someone point me to where I might find an article on this to look at some time.
#"Replaced Value1" = Table.ReplaceValue(#"Clean Names","GAF ","",Replacer.ReplaceText,{"ITEM Name Short","ITEM ProductName"}),
#"Replaced Value2" = Table.ReplaceValue(#"Replaced Value1","BKC ","",Replacer.ReplaceText,{"ITEM Name Short","ITEM ProductName"}),
#"Replaced Value3" = Table.ReplaceValue(#"Replaced Value2","PZA ","",Replacer.ReplaceText,{"ITEM Name Short","ITEM ProductName"}),
#"Replaced Value4" = Table.ReplaceValue(#"Replaced Value3","PZC ","",Replacer.ReplaceText,{"ITEM Name Short","ITEM ProductName"}),
#"Replaced Value5" = Table.ReplaceValue(#"Replaced Value4","BKA ","",Replacer.ReplaceText,{"ITEM Name Short","ITEM ProductName"}),
#"Replaced Value6" = Table.ReplaceValue(#"Replaced Value5","GFT ","",Replacer.ReplaceText,{"ITEM Name Short","ITEM ProductName"}),
I guess also there is a way to do this using a separate table of replacement names - can someone point me to where I might find an article on this to look at some time.