Is there a way to use vector style data groupings in Beast Mode?

I am trying to find a quicker way to use grouped data values in a column to filter an issue. Let's say I want to say any records that are A,B, and D should be marked "Inefficient" out of column Alpha that has values A,B,C,D,E. In something like R I would do this by using a similar code:
v-Inefficient <- c{"A","B","D"}
Using that logic utilize some kind of beast mode where:
(Case when Alpha = v-Inefficient then 'Inefficient'
else efficient
end)
Even if I could have a method of grouping to filter in the beast mode like:
(Case when Aplpha = {'A', 'B', 'D'} then 'v-Inefficient'
else 'Efficient'
End)
Is there a way to replicate this concept in a Domo Beast mode? I have some situations where I am grouping off of larger beast modes, and then boiling down those beast mode results to isolated criteria per a filter.
Best Answer
-
In SQL syntax we write this as follows:
CASE
WHEN `Alpha` IN ('A', 'B', 'D')
THEN `v-Inefficient`
WHEN `Alpha` IN ('C', 'E')
THEN `v-Efficient`
END
This should do exactly what you are looking for.
KurtF
**Say “Thanks” by clicking the “heart” in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"1
Answers
-
You can't declare variables or nest Beast Bodes in Beast Mode, but something like a case statement using LIKE would work. It would just get 'wordy'?
CASE
WHEN Alpha LIKE '%A%' OR Alpha LIKE '%B%' or Alpha LIKE '%D%'
THEN 'v-Inefficient'
ELSE 'Efficient'
END
Aaron
MajorDomo @ Merit Medical
**Say "Thanks" by clicking the heart in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"1 -
Yeah, my beast modes were getting ridiculously wordy... I was also overlaying other beast modes that would have more words, so I was hoping there was a quick and dirty simple way through. What you are showing is the only method I can find to work as well. Thank you so much for you help and time.
1 -
Nested beast modes would take care of this pretty quick, so you could reuse code and keep busy beast modes simpler. Until then, to crazy town we go.
Aaron
MajorDomo @ Merit Medical
**Say "Thanks" by clicking the heart in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"1 -
In SQL syntax we write this as follows:
CASE
WHEN `Alpha` IN ('A', 'B', 'D')
THEN `v-Inefficient`
WHEN `Alpha` IN ('C', 'E')
THEN `v-Efficient`
END
This should do exactly what you are looking for.
KurtF
**Say “Thanks” by clicking the “heart” in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"1 -
I read your message to mean the field would contain a string of comma separated values like 'A,B,D'. In that case, the LIKE style statement would be correct. If the column is only ever a single character, @KurtF's response is the better, simpler way.
Aaron
MajorDomo @ Merit Medical
**Say "Thanks" by clicking the heart in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"0
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
- 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