Grouping Values into Ranges

Hello, I am trying to group values into ranges in DOMO, but can't seem to get my beast mode to work. Am I doing something wrong?
I am trying 2 different methods:
1.
case
WHEN `Sale Liability` >= 50000000 AND <= 100000000 then '$50M-$100M'
WHEN `Sale Liability` >= 100000000 AND <= 250000000 then '$100M-$250M'
when `Sale Liability` >= 250000000 AND <= 500000000 then '$250M-$500M'
when `Sale Liability` > 500000000 then '$500M+'
else 0 end
2.
case
WHEN `Sale Liability` BETWEEN 50000000 AND 100000000 then '$50M-$100M'
WHEN `Sale Liability` BETWEEN 100000000 AND 250000000 then '$100M-$250M'
when `Sale Liability` BETWEEN 250000000 AND 500000000 then '$250M-$500M'
when `Sale Liability` > 500000000 then '$500M+'
else 0 end
Any help would be greatly appreciated!
Best Answers
-
Method 1 is closest to what you would need for beast mode. The only change you need to repeat Sale Liability again after the AND.
case WHEN `Sale Liability` >= 50000000 AND `Sale Liability` <= 100000000 then '$50M-$100M' WHEN `Sale Liability` >= 100000000 AND `Sale Liability` <= 250000000 then '$100M-$250M' when `Sale Liability` >= 250000000 AND `Sale Liability` <= 500000000 then '$250M-$500M' when `Sale Liability` > 500000000 then '$500M+' else 0 end
0 -
Domo is somehow not seeing my back ticks.
** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **0 -
Alternatively, because CASE statements will exit on the first condition that's true, you can go in reverse order to simplify your beast mode as the prior conditions are implied as false.
CASE WHEN `Sale Liability` >= 500000000 THEN '$500M+' WHEN `Sale Liability` >= 250000000 THEN '$250M-$500M' WHEN `Sale Liability` >= 100000000 THEN '$100M-250M' WHEN `Sale Liability` >= 50000000 THEN '$50M-100M' ELSE 'Below $50M' END
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0
Answers
-
Method 1 is closest to what you would need for beast mode. The only change you need to repeat Sale Liability again after the AND.
case WHEN `Sale Liability` >= 50000000 AND `Sale Liability` <= 100000000 then '$50M-$100M' WHEN `Sale Liability` >= 100000000 AND `Sale Liability` <= 250000000 then '$100M-$250M' when `Sale Liability` >= 250000000 AND `Sale Liability` <= 500000000 then '$250M-$500M' when `Sale Liability` > 500000000 then '$500M+' else 0 end
0 -
Make sure you have your conditions exculsive.
CASE
WHEN Sale Liability >= 50000000 AND Sale Liability < 100000000 THEN '$50M-$100M'
WHEN Sale Liability >= 100000000 AND Sale Liability < 250000000 THEN '$100M-$250M'
WHEN Sale Liability >= 250000000 AND Sale Liability < 500000000 THEN '$250M-$500M'
WHEN Sale Liability >= 500000000 THEN '$500M+'
ELSE 'Below $50M'
END** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **0 -
Domo is somehow not seeing my back ticks.
** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **0 -
Alternatively, because CASE statements will exit on the first condition that's true, you can go in reverse order to simplify your beast mode as the prior conditions are implied as false.
CASE WHEN `Sale Liability` >= 500000000 THEN '$500M+' WHEN `Sale Liability` >= 250000000 THEN '$250M-$500M' WHEN `Sale Liability` >= 100000000 THEN '$100M-250M' WHEN `Sale Liability` >= 50000000 THEN '$50M-100M' ELSE 'Below $50M' END
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0
Categories
- All Categories
- 2K Product Ideas
- 2K Ideas Exchange
- 1.6K Connect
- 1.3K Connectors
- 308 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 3.8K Transform
- 660 Datasets
- 117 SQL DataFlows
- 2.2K Magic ETL
- 815 Beast Mode
- 3.3K Visualize
- 2.5K Charting
- 84 App Studio
- 46 Variables
- 779 Automate
- 191 Apps
- 482 APIs & Domo Developer
- 83 Workflows
- 23 Code Engine
- 41 AI and Machine Learning
- 20 AI Chat
- 1 AI Playground
- 2 AI Projects and Models
- 18 Jupyter Workspaces
- 413 Distribute
- 121 Domo Everywhere
- 281 Scheduled Reports
- 11 Software Integrations
- 145 Manage
- 141 Governance & Security
- 8 Domo Community Gallery
- 49 Product Releases
- 12 Domo University
- 5.4K Community Forums
- 41 Getting Started
- 31 Community Member Introductions
- 115 Community Announcements
- 4.8K Archive