Forum Discussion

marsclone's avatar
marsclone
Helper IV
3 years ago
Solved

Replace table value

I would like to replace the following If column Artikelcode = 99980 or 99981 and column Artikelgroep = 170101 or 170103 then change column Artikelgroep to 170199   I have this formula, but strange...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Actually this not strictly an issue with parentheses; even with the parentheses in the prior answer, the expression would cause an error.  You must use an identifier for each and/or clause. This would be correct:

     

    = Table.ReplaceValue(#"Rijen gefilterd2", each [Artikelgroep], each if ([Artikelgroep] = 170101 or [Artikelcode]= 170103) and ([Artikelcode] = 99980 or [Artikelcode] = 99981) then 170199 else [Artikelgroep], Replacer.ReplaceValue,{"Artikelgroep"})

     

    --Nate