Creating a beastmode that filters
Hi,
I am having a hard time with this simple task.
I have a column in my dataset called Lane, which is formatted as followed 'PointA>PointB.'
I am trying to create a card on a dashboard that if PointB is selected it will filter all lanes that either start with PointB or end with PointB (exmple 'PointA>PointB' would show up and 'PointB-PointC' would show up.)
Ive tried creating a beastmode which is called CitySelector which its just the shipperCity column. I then tried to create this beastmode but its only getting lanes that start with whats selected in the CitySelecor Filter. Any Ideas why?
CASE WHEN Lane
LIKE CONCAT('%', CitySelector
, '%') THEN 'Y' ELSE 'N' END
Thanks for the help!
Best Answers
-
Hi @ColinHaze,
How about using variables for this with a search field? Would it be a viable solution? Here's an example.
If you found this post helpful, please use π‘/π/π/π below! If it solved your problem, don't forget to accept the answer.
0 -
Short answer, no.
Manasi suggested using text-input as the control, which is probably the easiest way for this use case.
For a drop-down, once you laboriously populate the variable, it can be a pain to make sure the values you have populated for the variable on your card are the same as the ones you have in your control, as each instance of a control for a variable can have a unique list, and it does not stay synced with any other list. So if your city list changed at all, it would not be dynamic, and even manually updating it can be buggy.
Please π‘/π/π/π this post if you read it and found it helpful.
Please accept the answer if it solved your problem.
0 -
Hello @ColinHaze,
Create a Search Variable like this:Create a CASE statement in Beast mode like this:
CASE WHEN `Search Filter` = '' THEN 'TRUE' ELSE (CASE WHEN `Lane` LIKE CONCAT('%',`Search Filter`,'%') THEN 'TRUE' ELSE 'FALSE' END) ENDAdd Beast mode formula to βFilterβ with the following settings:
If you found this post helpful, please use π‘/π/π/π below! If it solved your problem, don't forget to accept the answer.
0
Answers
-
It appears logically sound. Can you give some examples of city/lane combinations that worked in your filter and ones that did not work?
I suspect it's some text formatting thing. Wrapping your variables in UPPER() and TRIM() might be good, to make sure it's not a case/white space issue. If that doesn't do it, I'd need to see when it's working/not working to be able to de-bug.
Please π‘/π/π/π this post if you read it and found it helpful.
Please accept the answer if it solved your problem.
0 -
Hi @ColinHaze,
Could you please show the values in 'shipperCity'?
If you found this post helpful, please use π‘/π/π/π below! If it solved your problem, don't forget to accept the answer.
0 -
Here is some sample Data. CitySelector is a beastmode that is the shipper_city_State Field.
When I select a certain city off the cityselector, only those with matching shipper_city_states appear on the card, none with matching consignee_city_states appear.
0 -
Hello @ColinHaze,
The issue likely arises because 'Shipper_City_State' and 'CitySelector' have identical values, causing the 'CitySelector' filter to also apply to this column and exclude all rows where 'Consignee_City_State' matches 'CitySelector'.
If you found this post helpful, please use π‘/π/π/π below! If it solved your problem, don't forget to accept the answer.
0 -
Hi @ColinHaze,
How about using variables for this with a search field? Would it be a viable solution? Here's an example.
If you found this post helpful, please use π‘/π/π/π below! If it solved your problem, don't forget to accept the answer.
0 -
I see the problem with your approach. Your filter is looking for rows where the CitySelector is in the Lane, but because the CitySelector is only the Shipper_City_State, there are no rows that exist where the CitySelector is the same as the Consignee.
For this approach to work, you'd need to double the length of your dataset, and have one lane where the CitySelector is the Shipper and a duplicate lane where the CitySelector is the Consignee.
Alternatively, @Manasi_Panov 's variable approach is sound, though you would rely on people being able to type out city names.
This is also a use case where being able to combine filters with an "OR" would be really helpful, which has been suggested a handful of times on the ideas exchange, although I'm sure a few more times wouldn't hurt.
Please π‘/π/π/π this post if you read it and found it helpful.
Please accept the answer if it solved your problem.
0 -
Manasi_Panov & DavidChurchman
Is there an easy way to populate the variables without having to manually enter all the citys in?0 -
Short answer, no.
Manasi suggested using text-input as the control, which is probably the easiest way for this use case.
For a drop-down, once you laboriously populate the variable, it can be a pain to make sure the values you have populated for the variable on your card are the same as the ones you have in your control, as each instance of a control for a variable can have a unique list, and it does not stay synced with any other list. So if your city list changed at all, it would not be dynamic, and even manually updating it can be buggy.
Please π‘/π/π/π this post if you read it and found it helpful.
Please accept the answer if it solved your problem.
0 -
Manasi_PanovΒ &Β DavidChurchman
Thank you both! Im gonna try out this text variable and see how it goes.
0 -
Hello @ColinHaze,
Create a Search Variable like this:Create a CASE statement in Beast mode like this:
CASE WHEN `Search Filter` = '' THEN 'TRUE' ELSE (CASE WHEN `Lane` LIKE CONCAT('%',`Search Filter`,'%') THEN 'TRUE' ELSE 'FALSE' END) ENDAdd Beast mode formula to βFilterβ with the following settings:
If you found this post helpful, please use π‘/π/π/π below! If it solved your problem, don't forget to accept the answer.
0
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
- 754 Beast Mode
- 61 App Studio
- 41 Variables
- 693 Automate
- 178 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