Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
2 years ago

Search and Replace

Hi - I have data we import daily and the name and amount of columns varies from day to day. I needed to do a dynamic replacement of text that dosent rely on column names being the same

 

This works

#"Replaced Value" = Table.ReplaceValue(ReplacedFailedWith,"Passed","100",Replacer.ReplaceValue,(Table.ColumnNames(#"ReplacedFailedWith")))

 

This is doing the same thing but i need to replace % with "" - this line seems to get ignored.

#"Replaced Value" = Table.ReplaceValue(ReplacedFailedWith,"%","",Replacer.ReplaceValue,(Table.ColumnNames(#"ReplacedFailedWith")))

 

if i use this command

#"Replaced Value1" = Table.ReplaceValue(#"Replaced Value","%","",Replacer.ReplaceText,{"Name of column 1", "name of column 2", "Name of Column 3"....... })  it works ok but i dont know how many columns there will be and dont know what they are called. 

2 Replies