Beast mode using AND and OR
Trying to run sales data to determine how many reps have open opportunities within one of the 5 products as well as of those opportunities which ones have status of closed. I am using this beast mode to find whenever the opportunity status doesn't = a status thats closed and the item is PBCS then put a 1 so I can sum/count the nuymber
SUM((CASE when ((`Opportunity Status` <> 'closed won' or `Opportunity Status` <> 'lost') and `Item` = 'ARM') then 1 else 0 end))
Issue is, it is still pulling opportunities with lost and closed won statuses. I have this same beast mode for all 5 items and they are all set as columns which I need to show up with their own distinct values
Secondly, I want to reverse it and find when the opportunties are marked closed won statuses to count/sum the number they have closed
ultimately need a card that shows total open opps per item by rep vs number of closed by that item
thanks!!
Best Answers
-
Are the values correct that we're filtering on? Like, are the capitalizations correct? Those are pretty specific strings to match.
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"2 -
1
Answers
-
How about something like this:
SUM(
CASE
WHEN `Item` = 'ARM' AND `Opportunity Status` NOT IN ( 'closed won','lost')
THEN 1
ELSE 0
END)
And
SUM(
CASE
WHEN `Item` = 'ARM' AND `Opportunity Status` = 'closed won'
THEN 1
ELSE 0
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"0 -
Hmmm still counted all opps no matter what the status. Looks like it is only reading the 'Item' = 'ARM' and is pulling all opps for that.
0 -
Are the values correct that we're filtering on? Like, are the capitalizations correct? Those are pretty specific strings to match.
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"2 -
Hi Aaron,
Circling back to this, do you know how I can make that a filter? I am showing all of the opportunities now per rep but I only want to see when they have 0 opportunities?
Thnaks for the help!
0 -
You cannot use an aggregate function as a filter. You could sort in ascending order and then the reps with 0 opportunities should be listed first.
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman1 -
@ST_-Superman-_ is correct. Filtering on aggregations is one of the top-requested features, I would estimate.
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 -
Thanks for the help.
Are there any work arounds, beastmodes, or any other way that you can think of that would allow me just to show all the 0s (without sorting).
Thanks!
0 -
Sorry, nothing that jumps out in my mind right now.
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 -
I'm wondering if a Windowed function would work for this:
SUM(
CASE
WHEN `Item` = 'ARM' AND `Opportunity Status` NOT IN ( 'closed won','lost')
THEN 1
ELSE 0
END)
OVER
(PARTITION BY `Employee Identifier`)
You would need to first have the data sorted by the employee identifier field for this to work. But this would provide a field the I think you could filter on. Haven't tested this though. If you have trouble, please provide a sample of your data and I'll see if I can get something working
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman0 -
That very well could be. Window functions aren't supported that I'm aware so I don't think there's any documentation to help out yet. It's all trial and error, hope and dissapointment for now. Lol.
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 -
They are a little tricky to get working, but window functions are available in beast mode.
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman1 -
To quote Joey from Friends, it may be a "moo" point anyway as I could not filter on this field.
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman0 -
1
-
Our domo instance doesnt allow Window functions in Beast mode. Is this something that needs to be turned on the admin side?
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 738 Beast Mode
- 57 App Studio
- 40 Variables
- 685 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 47 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 124 Manage
- 121 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive