Forum Discussion

sundayDriver's avatar
sundayDriver
Microsoft Employee
6 years ago
Solved

Remove stopwords from column

Hi,

I'm in Power Query and I'm trying to do the following:

I have one list called stopwords, which contains a list of words to be removed from a column data from another table.

How can I do this?

 

Thanks

  • Something like this:

    Table.TransformColumns(table, {"Column", each List.Accumulate(stopWordList, _, (current, next) => Text.Replace(current, next, ""))})

     

    Note that this will replace words that are part of a larger word. E.g. bathroom with stop word bath turns into room. 

1 Reply

  • artemus's avatar
    artemus
    Microsoft Employee

    Something like this:

    Table.TransformColumns(table, {"Column", each List.Accumulate(stopWordList, _, (current, next) => Text.Replace(current, next, ""))})

     

    Note that this will replace words that are part of a larger word. E.g. bathroom with stop word bath turns into room.