What is the problem with my beastmode?
I am trying to make an outlier flag that flags values 50% above of 50% below the budgeted, or daily goal mount. I made two threshold calculations(dailygoal / 2) & (dailygoal * 1.5). I keep getting an error message, but I am not sure what I am doing wrong.
Any suggestions?
Thanks, and my sql command is attached below.
CASE WHENDonors
BETWEENLower Budget Threshold
AND Upper Budget Threshold
THEN 'Normal'
ELSE
'Outlier'
END
Answers
-
@jasonm5545 I just commented on your other post that looked like the same question. Posting here as well so you have it.
The issue is the argument BETWEEN. Try this instead.
CASE WHEN Donors >= Lower Budget Threshold OR Donors < Upper Budget Threshold THEN 'Normal' ELSE 'Outlier' END
David Cunningham
** Was this post helpful? Click Agree 😀, Like 👍️, or Awesome ❤️ below **
** Did this solve your problem? Accept it as a solution! ✔️**1 -
Thanks! It helped solve the error but brought me to a different question. I changed the and to an or, and there is no error, but the outlier flag option does not even show in the filter pane. Any idea why?
0 -
This is my new sql command. For some reason, it is flagging everything as 'Normal', even with values clearly outside of the range.
CASE WHEN
Donors
<Lower Budget Threshold
ORDonors
>Upper Budget Threshold
THEN 'Outlier'ELSE 'Normal'
END0 -
Is Donors a numeric field and is it being stored as such? Are you aggregating any of your fields?
Please post some screenshots of your dataset and output so that I can try to figure out what's going on.
For example - you can see below that the logic is working as intended.
case when value < lower_bound or value > upper_bound then 'Outlier' else 'Normal' end
Yields the following result
David Cunningham
** Was this post helpful? Click Agree 😀, Like 👍️, or Awesome ❤️ below **
** Did this solve your problem? Accept it as a solution! ✔️**0 -
Donors is a numeric field, and so is both of the thresholds.
For example, this last column should be flaggeed, but is not. Every column is showing normal, and outlier is not even an option in the filter pane.
0 -
You're deafaulting to Normal if the Donors is null. You can add an additional clause in your case statement to handle NULL values:
case when value < lower_bound or value > upper_bound or value is null then 'Outlier' else 'Normal' end
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0 -
Thanks. When doing this, all it did was change the default to outlier. The flag is not picking up on both conditions.
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
- 755 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