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
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 753 Beast Mode
- 61 App Studio
- 41 Variables
- 692 Automate
- 177 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive