How to filter for Tags (many-one relationship - multiple tags per field)

I have a dataset containing tags in which a row might have multiple tags applied. For example:
Keyword -- Tag(s)
Car -- blue
truck -- green, red
bike -- yellow, red, purple
How can I set up a filter for a dashboard/card which will allow me to filter down to just trucks and bikes when I filter by "red". Or just trucks when I filter by "green". Or cars and bikes when I filter by "blue" and "purple"?
I've tried case statements in Beast Mode (i.e. Case when Tag(s)
like '%green%' then 'green' when Tag(s)
like '%blue%' then... but it appears the Beast mode will select the first one that's applicable for each... so if I filter by "red" with this, it won't include either the trucks or bikes....
Thanks for any help!
Answers
-
Hi @User_32265
You could use a contains filter instead of selecting a value from the list. Alternatively you could have your dataset list each record with the different tag for each record making sure to handle any possible duplicate records in your card processing.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0 -
Thanks Grant. Are there any particular techniques you can advise on for handling duplicate records in my card processing?
If my example was the complete dataset, I'd want just 3 fields being pulled (car, truck, bike) if no filters were applied. Or if the user selects "yellow" and "purple", just one field (bike) would pop up (not 2: bike-yellow and bike-purple).
0 -
@GrantSmith is giving you solid advice.
Typically there are two ways to handle 'mult-valued columns'.
1) you can increase your row count (one row per value) OR
2) you can add columns for isGreen isBlue isRed.
to handle avoid showing duplicate records, you could UNION a version of the row (car, truck bike) with the color "All Colors" this way when you filter to "All Colors" you know you don't have row duplication.
Jae Wilson
Check out my 🎥 Domo Training YouTube Channel 👨💻
**Say "Thanks" by clicking the ❤️ in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"0 -
Hey @jaeW_at_Onyx
I'm solving a similar problem to the one here.
Reading through this, I somewhat confused on your last comment. Specifically this:
"… you could UNION a version of the row (car, truck bike) with the color "All Colors" this way when you filter to "All Colors" you know you don't have row duplication. "
I'm not sure what you mean here. Can you give an example? Would this be done in a dataflow? Or the original query for the datasource? And how does this exactly remove row duplication. I would assume the table would look something like this:
Keyword | Tag(s)
---------------------
Car | blue
Truck | green
Truck | red
Bike | yellow
Bike | red
Bike | purple0
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
- 811 Beast Mode
- 3.3K Visualize
- 2.5K Charting
- 80 App Studio
- 45 Variables
- 771 Automate
- 190 Apps
- 481 APIs & Domo Developer
- 77 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
- 142 Manage
- 138 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