Forum Discussion

cristianml's avatar
cristianml
Icon for Post Prodigy rankPost Prodigy
4 years ago
Solved

Replace values/Strings from a Column in query editor

Hi,   I need help with the following in query editor. It gives an error:     I'm trying to replace IF those values/strings are in each row from from the COLUMN1   Could you please help m...
  • tackytechtom's avatar
    tackytechtom
    4 years ago

    Hi cristianml ,

     

    Now I see where you wanna get to! 🙂 This one right?

     



    Try this:

    Table.ReplaceValue(#"Changed Type", each [COLUMN1], 
    each if Text.Contains([COLUMN1], "January") then Text.Replace([Custom], "January", "01")
    else if Text.Contains([COLUMN1], "February") then Text.Replace([Custom], "February", "02")
    else if Text.Contains([COLUMN1], "March") then Text.Replace([Custom], "March", "03")
    else if Text.Contains([COLUMN1], "April") then Text.Replace([Custom], "April", "04")
    else if Text.Contains([COLUMN1], "May") then Text.Replace([Custom], "May", "05")
    else if Text.Contains([COLUMN1], "June") then Text.Replace([Custom], "June", "06")
    else if Text.Contains([COLUMN1], "July") then Text.Replace([Custom], "July", "07")
    else "NADA", Replacer.ReplaceText,{"COLUMN1"})

     

    Is this the solution? 🙂

     

    /Tom
    https://www.tackytech.blog/
    https://www.instagram.com/tackytechtom/