Finding Average Depending on Warehouse
Hey Everyone,
I am trying to make a card that finds the average of each warehouse depending on how quickly they unload a container. Then I will be giving them a "Grade" (A,B, C, D, F) depending on there average for the Year, Quarter, Month, and week. The thing that I am struggling to figure out is how can I have domo do an average for each of the warehouses M, G, W.
The attatched image shows the "ship date minus Release date" (which is a calculated field) I want this to corelate with the "warehouse" column so that I can find the average per warehouse.
Let me know if you need any clarifying details.
And thank you for your help!
Best Answer
-
So I am assuming by your comment that you want to assign a letter grade to the average?
So you could have this in a table format by writing another beastmode with a case statement for the letter grades. Something like ...
case when avg(days) < 3 then A
when avg(days) < 5 then B
etc ... ENDThen your table would have Warehouse, Average Score, and Letter Grade.
You could also do this in either Magic ETL or a MySQL DataFlow. Basically creating an aggregated table like below. This will allow you to show your average days and the corresponding grade in a table structure.
drop table if exists warehouseaverages;
create table warehouseaverages as
select warehouse
,avg(days) as averagedays
from warehousedays
group by warehouse;
-- then create another table off of that last table
drop table if exists warehousegrades;
create table warehousegrades as
select warehouse
,averagedays
,case when averagedays < 3 then A
when averagedays < 5 then B
etc ... END AS warehouse grade
from warehouseaveragesBrian
**Please mark "Accept as Solution" if this post solves your problem
**Say "Thanks" by clicking the "heart" in the post that helped you.
**Please mark "Accept as Solution" if this post solves your problem
**Say "Thanks" by clicking the "heart" in the post that helped you.0
Answers
-
You can create a beastmode in a card that is simply AVG(`ship date minus release date`) then use the Warehouse Name as either the series or the x axis. This will give you the average of a given warehouse depending on the date range you choose.
Thanks,
Brian
**Please mark "Accept as Solution" if this post solves your problem
**Say "Thanks" by clicking the "heart" in the post that helped you.
**Please mark "Accept as Solution" if this post solves your problem
**Say "Thanks" by clicking the "heart" in the post that helped you.0 -
This would mean I would have to use a Bar Graph which would then not allow me to have a letter grade showing on the card. Or is there a way to still incorperate the letter grade it would recieve?
0 -
So I am assuming by your comment that you want to assign a letter grade to the average?
So you could have this in a table format by writing another beastmode with a case statement for the letter grades. Something like ...
case when avg(days) < 3 then A
when avg(days) < 5 then B
etc ... ENDThen your table would have Warehouse, Average Score, and Letter Grade.
You could also do this in either Magic ETL or a MySQL DataFlow. Basically creating an aggregated table like below. This will allow you to show your average days and the corresponding grade in a table structure.
drop table if exists warehouseaverages;
create table warehouseaverages as
select warehouse
,avg(days) as averagedays
from warehousedays
group by warehouse;
-- then create another table off of that last table
drop table if exists warehousegrades;
create table warehousegrades as
select warehouse
,averagedays
,case when averagedays < 3 then A
when averagedays < 5 then B
etc ... END AS warehouse grade
from warehouseaveragesBrian
**Please mark "Accept as Solution" if this post solves your problem
**Say "Thanks" by clicking the "heart" in the post that helped you.
**Please mark "Accept as Solution" if this post solves your problem
**Say "Thanks" by clicking the "heart" in the post that helped you.0
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.9K Visualize
- 2.5K Charting
- 738 Beast Mode
- 57 App Studio
- 40 Variables
- 685 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 47 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 124 Manage
- 121 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive