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 ,
Maybe something like this?
You could create a nested if statement with all your conditions. Here an example
Here the code:
if [CompanyName] = "Publix" or [CompanyName] = "Costco" then "Chain" else [Type]
Alternatively, you could create an own mapping table according to your definition and then you merge the mapping table with your large table on CompanyName.
Let me know if this helps! 🙂
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
- park4 years agoFrequent Visitor
Thanks! This look like it might work. I will try in a second 🙂
Will this work for approximate matches too? Like lets say I have Publix #1 - Publix #100thanks!
- tackytechtom4 years ago
Most Valuable Professional
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/- park4 years agoFrequent Visitor
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