Case statement clarification
This seems pretty straightfoward, but I wasn't able to find a definitive answer searching Domo or Google. We're hoping to clarify whether the beast mode formula (case statement using "OR") will return a total count of five (5), i.e. count each row one time or eleven (11), i.e. instead counting EACH instance of a condition being met individually. An example of the beast mode & data being used is below.
Thanks in advance for any clarification provided...
Beast Mode:
(CASE
WHEN (`Record.Name` LIKE '%Team1%'
OR `Owner.Title` LIKE '%Team1%'
OR `Owner.Name` = 'Loss Prevention - Direct'
OR `Owner.Name` = 'Loss Prevention - Indirect'
OR `Owner.Name` = 'Claim Follow-up - Direct'
OR `Owner.Name` = 'Claim Follow-up - Indirect'
OR `Owner.Name` LIKE '%Team1%') THEN 1
ELSE 0
END) END)
Data:
Best Answer
-
In your example a count on the beastmode would return 5. Once a value is found in a multiple OR statement like that, it immediately dumps out to the THEN and ENDS. It wouldn't get caught multiple times in the same count.
Hope that clarifies. If not, please let me know.
Sincerely,
ValiantSpur
**Please mark "Accept as Solution" if this post solves your problem
**Say "Thanks" by clicking the "heart" in the post that helped you.3
Answers
-
I haven't been able to use OR statements succesfully in beast mode but I don't think it will count it separately because, from my understanding of how the case statement works, as soon as it gets to the first condition that is true, it will stop going through the rest of the statement. For example, if a record meets the `Record.Name` LIKE '%Team1%' condition, it will jump to the Then statement and stop. It will not continue to go through the rest of the case statement.
Also, i don't think the case statement as you have it will work in a beast mode. I think you'll have to change it to something like:
CASE
WHEN `Record.Name` LIKE '%Team1%' THEN 1
WHEN `Owner.Title` LIKE '%Team1%'THEN 1
WHEN `Owner.Name` = 'Loss Prevention - Direct' THEN 1
WHEN `Owner.Name` = 'Loss Prevention - Indirect' THEN 1
WHEN `Owner.Name` = 'Claim Follow-up - Direct' THEN 1
WHEN `Owner.Name` = 'Claim Follow-up - Indirect' THEN 1
WHEN `Owner.Name` LIKE '%Team1%' THEN 1
ELSE 0
ENDDomo Arigato!
**Say 'Thanks' by clicking the thumbs up in the post that helped you.
**Please mark the post that solves your problem as 'Accepted Solution'2 -
In your example a count on the beastmode would return 5. Once a value is found in a multiple OR statement like that, it immediately dumps out to the THEN and ENDS. It wouldn't get caught multiple times in the same count.
Hope that clarifies. If not, please let me know.
Sincerely,
ValiantSpur
**Please mark "Accept as Solution" if this post solves your problem
**Say "Thanks" by clicking the "heart" in the post that helped you.3 -
-
@John-Peddle That's correct
1 -
Thank you both for your assistance! Thought I'd read something previously that stated what your replies indicated but for the life of me couldn't locate that information anywhere in a search, and just wanted to be certain. Have a great day!
2
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 302 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 104 SQL DataFlows
- 633 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 760 Beast Mode
- 62 App Studio
- 42 Variables
- 699 Automate
- 181 Apps
- 457 APIs & Domo Developer
- 51 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 401 Distribute
- 116 Domo Everywhere
- 277 Scheduled Reports
- 8 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 12 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 111 Community Announcements
- 4.8K Archive