Forum Discussion

datadmin-austin's avatar
3 years ago
Solved

Delete Words from Row

Hello All,   I am not sure if this is possible. I have rows of data with user names seperated by commas. Each row has two of the same user names "user1" and "user2" with a 3rd name that is typicall...
  • mangaus1111's avatar
    3 years ago

    In PQ you can use this code

     

    #"Changed Type" = Table.TransformColumnTypes(Facts44_Table,{{"User", type text}}),
    #"Replaced Value" = Table.ReplaceValue(#"Changed Type","user1","",Replacer.ReplaceText,{"User"}),
    #"Replaced Value1" = Table.ReplaceValue(#"Replaced Value","user2","",Replacer.ReplaceText,{"User"}),
    #"Replaced Value2" = Table.ReplaceValue(#"Replaced Value1",",","",Replacer.ReplaceText,{"User"}),
    #"Trimmed Text" = Table.TransformColumns(#"Replaced Value2",{{"User", Text.Trim, type text}})
    in
    #"Trimmed Text"

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.