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
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 299 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 729 Beast Mode
- 54 App Studio
- 40 Variables
- 680 Automate
- 175 Apps
- 451 APIs & Domo Developer
- 46 Workflows
- 8 DomoAI
- 34 Predict
- 14 Jupyter Workspaces
- 20 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 121 Manage
- 118 Governance & Security
- Domo Community Gallery
- 33 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive