Forum Discussion
Moving values to a new column based on another column
- 4 years ago
Hi park ,
The above code won't work with approximate matches. Try this one instead:
Here the code:
if Text.Contains([CompanyName], "Publix") or Text.Contains([CompanyName], "Costco") then "Chain" else [Type]
Hope this helps 🙂
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
Hi park ,
The above code won't work with approximate matches. Try this one instead:
Here the code:
if Text.Contains([CompanyName], "Publix") or Text.Contains([CompanyName], "Costco") then "Chain" else [Type]
Hope this helps 🙂
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
Thank you! And if I have lets say 20 different company names, I can continue the OR statement as many times as needed? Or does it only work for two arguments
- tackytechtom4 years ago
Most Valuable Professional
Hi park ,
This should work for as many arguments. Please keep in mind that someone needs to update that code in case new companies are added. A better way would probably be to fix that data issue in the source itself (just saying 🙂 )
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/- park4 years agoFrequent Visitor
Thank you for the solution. This works great ! 🙂
Is this argument case sensitive as well? If so, is there a way to get around?