Identify Multiple Different Matches in Same Column

Hello,
I'm looking to be able to build cards that compare different products that are tied to different opportunities. The data currently comes in via one column, and if multiple products are on the opportunity, it is comma-deliminated.
OPPNUM Products
12345 Product1,Product2,Product3
I've tried doing via Beast Mode:
CASE WHEN 'Products' LIKE '%Product1%' = 'Product1'
WHEN 'Products' LIKE '%Product2%' = 'Product2'
etc.
end
However if it matches on Product1, that entire Opp is then tied to Product1 and it doesn't seem to check for Product2'. I'm fine if the same opportunity becomes listed multiple times for each product, but it doesn't do that, it just assigns Product1 and forgets about the rest.
Looking for any help.
Thanks!
Comments
-
I would recommend using magic ETL to first split your product column and then Collapse Columns to convert those column values into rows.
The output you would be looking for would look more like this:
OPPNUM Products
12345 Product1
12345 Product2
12345 Product3
22222 Product1
...If you need to keep this in a beastmode calculation, you will need to write a separate beastmode for each product.
The way the Case statement gets evaluated is that it looks for the first condition that is true and then stops evaluating. So in your example, if Product 1 was listed, then it would never look for any other products.
You would need to write a beastmode for each product.
Product1:
CASE WHEN `Products` LIKE '%Product1%' then 'Product1' END
Product2:
CASE WHEN `Products` LIKE '%Product2%' then 'Product2' END
Product 3:
CASE WHEN `Products` LIKE '%Product3%' then 'Product3' END1
Categories
- All Categories
- 2K Product Ideas
- 2K Ideas Exchange
- 1.6K Connect
- 1.3K Connectors
- 311 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 3.8K Transform
- 656 Datasets
- 115 SQL DataFlows
- 2.2K Magic ETL
- 813 Beast Mode
- 3.3K Visualize
- 2.5K Charting
- 81 App Studio
- 45 Variables
- 772 Automate
- 190 Apps
- 481 APIs & Domo Developer
- 78 Workflows
- 23 Code Engine
- 36 AI and Machine Learning
- 19 AI Chat
- AI Playground
- AI Projects and Models
- 17 Jupyter Workspaces
- 410 Distribute
- 120 Domo Everywhere
- 280 Scheduled Reports
- 10 Software Integrations
- 143 Manage
- 139 Governance & Security
- 8 Domo Community Gallery
- 48 Product Releases
- 12 Domo University
- 5.4K Community Forums
- 41 Getting Started
- 31 Community Member Introductions
- 114 Community Announcements
- 4.8K Archive