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.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