Variable group selections for ratio calculations
I have a need to display a ratio for two groups of names. First group is a single selection of one name and showing the calculated impact ratio (impacted divided by total). Second group is a multi-selection of other names and showing the calculated impact ratio (sum of impacted divided by sum of total).
I created two filter cards on the dashboard that only impact the bar chart but not each other. One to select the first group and another to select the second group.
First Group Ratio: sum(impacted
) / sum(total
) FIXED (BY category
FILTER ALLOW Name
)
Second Group Ratio: sum(impacted
) / sum(total
) FIXED (BY category
FILTER DENY Name
)
Sample dataset below with expected result calculations for validation:
The fixed by functions don't return the expected results in a grouped bar chart with the two ratios. Eg. selecting name = A for the first group and all 3 names for the second group returns 10% for impacted ratio of first group which is correct. But the group 2 ratio comes back as 3% rather than 38%.
I thought it might have to do with a lack of the additional sum function around the fixed by but that fails the beast mode validation.
sum(sum(impacted
) / sum(total
) FIXED (BY category
FILTER DENY Name
))
Comments
-
I since discovered this prior thread with a similar challenge. The difference being the simpler aggregation that doesn't contain embedded calculations for the ratios. https://community-forums.domo.com/main/discussion/56246/compare-two-peer-groups
0 -
Found a lead here to avoid the syntax error from the fixed function containing division.
https://community-forums.domo.com/main/discussion/67010/nested-fixed-functions
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
- 755 Beast Mode
- 61 App Studio
- 41 Variables
- 693 Automate
- 178 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