Adjustable % column
I'm working on an ask that I'm not sure is possible to meet. I have delivery data that I need to calculate the on time percentage over an adjustable timeframe. My key columns are supplier name (column1), PO lines delivered (column2), and PO lines delivered on-time (column3). I also need to display a column that show the percentage of lines that were delivered on-time (column3/column2). The difficulty I'm running into is that the on-time percentage has to be calculated at a fixed timeframe, so regardless of whether I've built it as a beast mode or in ETL, it's "set" at a week or month or however I aggregated the number of lines. My boss wants the on-time % to adjust and be accurate whether we've quick filtered to a week or a month or a year of data. The second image below shows that this causes duplicate lines for each company since I can aggregate the total lines and the lines on time but not the % on-time.
I've been thinking through this a lot and I believe the problem comes down to the order of operations. The % on-time calculation has to be done at whatever timeframe I set within the beast mode or in ETL prior to aggregation. What I'm being asked to do is perform a division calculation AFTER aggregation.
Does anyone know of a way to do this or a workaround?
Best Answer
-
Ahh, I see that now in the sample data I mocked up. When I changed the beast mode from
(`Lines on Time`) / (`Number of Lines`)
to
SUM(`Lines on Time`) / SUM(`Number of Lines`)
then the average aggregation works properly.
Give that a try and see how it works for you.
**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.2
Answers
-
On your columns, set the aggregation to Sum for your Number of Lines and your Lines on Time columns. On the % on time, set that aggregation to Average. This should allow Domo to auto-calculate for you no matter how many weeks are selected and just show one company per row.
**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.0 -
Thank you for the suggestion. Unfortunately, the math doesn't work out for this.
Example: Company A received 5 lines during week 1 and all 5 lines were on-time. The on-time % for that week is 100%. Week 2, they received 10 lines and all 10 were late. The on-time % for that week is 0%. Looking at weeks 1 & 2 together and using the sum aggregation on number of lines & lines on-time but the avg aggregation on on-time %, it would read 15 lines received, 5 on-time, 50% on-time when it should read 33% on-time.
I appreciate the suggestion and it gets it close but not close enough.
0 -
Ahh, I see that now in the sample data I mocked up. When I changed the beast mode from
(`Lines on Time`) / (`Number of Lines`)
to
SUM(`Lines on Time`) / SUM(`Number of Lines`)
then the average aggregation works properly.
Give that a try and see how it works for you.
**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.2 -
Aggregating within the beast mode did the trick. Thank you so much!
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
- 129 Manage
- 126 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