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
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 731 Beast Mode
- 55 App Studio
- 40 Variables
- 682 Automate
- 175 Apps
- 451 APIs & Domo Developer
- 46 Workflows
- 10 DomoAI
- 35 Predict
- 14 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 122 Manage
- 119 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 107 Community Announcements
- 4.8K Archive