Calculating percentage in beast mode based on count
Hi, I have a dataset that looks like this:
Network Hour Date Avails A 1 1/1 2 A 2 1/2 4 B 1 1/1 6 B 2 1/2 8 C 1 1/1 10 C 2 1/2 12 C 2 1/2 12
The number of avails is the same for every row that has the same network, hour, and date. I need to write a beast mode that calculates the number of different rows that have the same network, hour, and date, and divide that count by the number of avails (not summed). So for the last two rows, the calculation would be 2 / 12. This needs to be in beast mode since the calculation will change depending on certain filters.
Thank you!
Best Answer
-
The numerator seems like it will be a straight count.
For the denominator, you want an average of the Avails fixed by your distinct grouping.
count(
Network
)/(AVG(Avails
) FIXED(ByNetwork
,Hour
,Date
))Please π‘/π/π/π this post if you read it and found it helpful.
Please accept the answer if it solved your problem.
1
Answers
-
The numerator seems like it will be a straight count.
For the denominator, you want an average of the Avails fixed by your distinct grouping.
count(
Network
)/(AVG(Avails
) FIXED(ByNetwork
,Hour
,Date
))Please π‘/π/π/π this post if you read it and found it helpful.
Please accept the answer if it solved your problem.
1 -
@DavidChurchman I think this is the right track, but it's not perfect.
The second to last row (A, 3, M) should be 0.33 since it's one row with that Network/Hour/Date combo and 3 avails.
0 -
Hard to say what's going on. It looks like you added a few rows to your example data. Could you post a screen grab of the raw example dataset, too?
Please π‘/π/π/π this post if you read it and found it helpful.
Please accept the answer if it solved your problem.
0 -
@DavidChurchman sorry, I did add some rows just to test your formula since it wasn't working on my actual dataset.
I now realize that it's working as intended!! Sorry. I still don't know why it won't work with my dataset but I will look into it.
0 -
There are two A/3/M rows, so 2/3=.67 is correct, right?
Please π‘/π/π/π this post if you read it and found it helpful.
Please accept the answer if it solved your problem.
0 -
@DavidChurchman yes, that is correct, my apologies. Formula seems to work with the test dataset but not the actual so I will need to do some digging. Thank you!
1
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 296 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