Forum Discussion
spoony
9 years agoHelper I
Query editor replacing values based on another column
I can't seem to get this to work in query editor: let Source = Excel.Workbook #promote header = .... #"Replaced OTH" = Table.ReplaceValue(#"promote header"," ","OTH",Replacer.ReplaceValue,{"Ge...
- 9 years ago
You are right. I was confusing Table.ReplaceValues with Table.TransformColumns. :smileyembarrassed:
My solution works though, but the code you are looking for:
#"Replaced Value" = Table.ReplaceValue(#"Replaced OTH",each [Gender],each if [Surname] = "Manly" then "Male" else [Gender],Replacer.ReplaceValue,{"Gender"})Edit: it seems you switched "old" and "new" in your cide.
fra123
2 years agoNew Member
I am new to this, thank you in advance for your answers.
Have a dataset with 3 columns: Amount (decimal numbers positive and nebative values) - Id(several duplicate values - Type(a,b,c,d).
I just need to change values on amont upon conditions:
for type == "d" and amount <0 then change the amount into positive (abs value).
Is that possible? it seems a similar case to yours.
Thank you
F.