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.
0 -
@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.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
- 753 Beast Mode
- 61 App Studio
- 41 Variables
- 692 Automate
- 177 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