Help with the SUM function, I get "An issue has occurred during processing"
An issue has occurred during processing. We are unable to complete the request at this time.
when trying to run this function, this function tries to count the users that appear or have more than 100 records in the dataset
SUM(CASE WHEN (COUNT(UserId
) > 100) THEN 1 ELSE 0 END)
I appreciate any help or opinion
Answers
-
You can't do an aggregate on aggregate without using an OVER clause (window function) or the new fixed functions. Here is the KB article on fixed functions.
Another option is to only have this in your beast mode:
CASE WHEN (COUNT(
UserId
) > 100) THEN 1 ELSE 0 ENDThen once your drag into the field you want on your card, choose the aggregation type of sum.
**Check out my Domo Tips & Tricks Videos
**Make sure to any users posts that helped you.
**Please mark as accepted the ones who solved your issue.1 -
@MarkSnodgrass Hello, thanks for answering
I tried to follow your recommendations but I had no success, when dragging the calculated field created with Beast Mode I can't choose the aggregation type of sum.
Do you think there is another way to do it?
0 -
The general formula for a window function in Domo would look something like this:
- SUM(SUM( `fieldName` )) OVER (PARTITION BY `seriesName`)
You can allso use FIXED functions
- SUM(SUM( `fieldName` )) FIXED (BY `seriesName`)
That being said, you generally want to try to avoid nesting window functions within a calculated field. My initial suggestion here would be to have a dataflow calculate what you are looking for. Happy to help with that if you want to go down that road.
If we try to apply that fixed or window formula to your case, what are we partitioning the records by? You want to count how many times you had more than 100 userid's. But is that in a month? Or is it 100 userid's from a zip code, or some other field?
SUM(COUNT(`userID`)) FIXED (BY `zipCode`)
That would give you the number of userID's in a given zip code. To then count how many zip codes have more than 100 users I would try something like this:
COUNT(DISTINCT CASE WHEN SUM(COUNT(`userID`)) FIXED (BY `zipCode`) > 100 THEN `zipCode` END)
I'm not sure if Domo would like the nested window statement though.
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman0 -
@andresperezfc Can you please send a screenshot of the available aggregation types for this field?
0 -
In fact I can't choose any other type :(
0 -
I am going to try to explain myself better, what I am trying to do is identify how many times a person appears in a dataset, in my particular case I need to know the number of people who have created more than 100 contents
for example, in this dataset
the user Andrés has created 8 contents
Carlos has created 4 contents
David has created 4 contents
Julieta has created 6 contents
Maria has created 5 contents
Roberto has created 2 contentsThe formula that I am trying to do in beast Mode, is to know how many users have created, for example, more than 5 contents, the output should be 2, because only Juliet and Andrés have created more than 5 contents
0 -
@andresperezfc How do you current have your card set up in analyzer (i.e. chart type, filters, etc)
0 -
is a single value
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 297 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 614 Datasets
- 2.2K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 729 Beast Mode
- 53 App Studio
- 40 Variables
- 677 Automate
- 173 Apps
- 451 APIs & Domo Developer
- 45 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
- 32 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive