COUNT(DISTINCT creates An issue has occurred during processing. We... Error
I have created this first beastmode calc, and it seems to work just fine.
Case when `Total On Hand` - SUM(CASE when `Planned Shipment Date` < (CURDATE()+ 21) then `Outstanding Quantity` else 0 end) < 0 then `Item No` else 0 end
When I add a COUNT(DISTINCT to the end, it does not work and gives me the classic "An issue has occurred during processing. We..." error.
COUNT(DISTINCT Case when `Total On Hand` - SUM(CASE when `Planned Shipment Date` < (CURDATE()+ 21) then `Outstanding Quantity` else 0 end) < 0 then `Item No` else 0 end)
I would have expected it to work. Anybody have any suggestions?
Thanks
Best Answer
-
Learned MySQL and used that instead of trying to do it in BeastMode. Got the results I needed.
Thanks,
0
Answers
-
Try This one
COUNT(DISTINCT
Case when Sum(`Total On Hand`) - SUM(CASE when
`Planned Shipment Date` < (CURDATE()+ 21)
then `Outstanding Quantity` else 0 end) < 0 then `Item No` end)Domo 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'1 -
try dropping the else 0 off of the end of the case statement
(edit) @Godiepi apparently I should have refreshed my browser before posting my suggestion
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman1 -
I copied that new statement in and it still gives me the "An issue has occurred during processing" error.
0 -
There might be some Nulls that are causing the calculation to break so try adjusting your calculation for those Nulls like
COUNT(DISTINCT
Case when Sum(`Total On Hand`) - SUM(CASE when
`Planned Shipment Date` < (CURDATE()+ 21)
then ifnull(`Outstanding Quantity`,0) else 0 end) < 0 then `Item No` end)Domo 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'0 -
Is this beastmode being used for a summary number? Mind sharing the rest of the chart settings?
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman0 -
Not sure what you mean by summary, but my guess is that the answer is yes.
A little background. There are a list of items. Each item is assigned to a group.
If you look at the first picture attached, you can see that some items have a negative value in the Try 1 column. What I would like to do is get the number of items with a negative value to appear next to the Count of Parts column in the second picture. Once that is accomplished, we can see how many items are in each group and then how many have a negative value based on the criteria from the earlier posts.
As shown earlier, when I attempt to count the number of negative items via Count(Distincts and Case whens, it errors out.
Let me know what other info you might need.
Thanks for all of the help so far.
0 -
oh that looks a little different from the prior description of what you are trying to do, but focusing for now in the second picture you can have a table card with 3 columns:
1st column = Group
2nd column = Beastmode, lets call it "Count of Negatives"
code would be as simple as
ifnull(Count( Case when `Try 1` < 0 then `Try 1` end),0)
The reason why I am not doing a Count Distinct here is that if there are 2 or more negatives with the same value it would counted once
3rd column = `Try 1` , setting the aggregation to Count and naming the field "Count of Parts"
@ST_-Superman-_ any ideas ?
Domo 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'0 -
@user02631 I think this would be easier if we could get a sample of the data. Would you be able to share a sample of your dataset? Ideally, it would need to contain 2 or 3 groups with several of the items from each group. Feel free to anonymize the names of the items or groups, but without understanding the dataset structure, I think it will be very unlikely that we will get you the correct solution.
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman0 -
Learned MySQL and used that instead of trying to do it in BeastMode. Got the results I needed.
Thanks,
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