Need some help: Two Beast Modes
I've got two Beast Mode calculations related to supplier receiving measures I am having trouble with. Hoping you can help me transfer my Excel knowledge in the example here over to Beast Mode.
- Attached is a workbook with sample data, example of the finished report, and explainations of the calculations.
- Here is a video I put together to overview what I am trying to do, and more explaination.
The two Beast Modes I am needing help with are:
- Initial Fill Rate = Number of Lines Received First Receiving Day / Supplier Lines Received
- Average Shipments to Complete Order = Number of Receiving Events / Supplier Order Count
Thanks in advance for your help!
Best Answers
-
swagner,
The type of calculation you're hoping to do would need a little pre-work in a dataflow before writing the beast mode. Luckily, it isn't too tricky to do.
Here's a description of the Magic ETL dataflow:
Group the receiving data by "Order Number" and "Supplier", creating fields for Total Lines Received (SUM of Receiving Lines) and Date of First Receipt (MIN of Receipt Date) and then Join the result back onto the original data. Then we filter the data to distinguish between initial receipts and subsequent receipts and label them accordingly. Then we bring the data back together and output it. (See attached image for steps required).
Now you can create a beast mode for the Initial Fill Rate:
SUM(
CASE
WHEN `First Receipt` = 'TRUE' THEN `Receiving Lines`
ELSE 0
END
)
/
SUM(`Receiving Lines`)The second beast mode (Average Shipments to Complete Order) doesn't require any prework. It could be simply built like this:
COUNT(`Order Number`)
/
COUNT(DISTINCT `Order Number`)I hope that helps!
2 -
This request cannot be completed with a beast mode alone. Beast modes cannot perform functions to look accross multiple rows of data. You first need to add a field to your data set that will provide the First Receiving Day for each Order Number. I did this with an ETL:
I began by using your supplied data set as the input data set.
I then used the "Group By" action to create a new field, "First Receiving Day", for each Order Number:
Then you LEFT join the new field onto the original data set.
The Last step is to remove the duplicate fields with the Select Columns action and the create the output data set.
Now we can re-create your metrics using beast modes.
1: Receiving Lines
This is just the SUM of the field `Receiving Lines`
2: Lines Received First Receiving Day
This is a beast mode calculation.
sum(case when `Receipt Date` = `First Receiving Day` then `Receiving Lines` else 0 end)
3: Initial Fill Rate
Another Beast mode.
sum(case when `Receipt Date` = `First Receiving Day` then `Receiving Lines` else 0 end) / sum(`Receiving Lines`)
4: Receiving Events
count(`Receipt Date`)
5: Supplier Order Count
COUNT(DISTINCT `Order Number`)
6: Avg Shipments to Complete Order
(count(`Receipt Date`) / COUNT(DISTINCT `Order Number`))
As a side note, when you build the card, you will need to add the Supplier field to the Sorting section
2
Answers
-
swagner,
The type of calculation you're hoping to do would need a little pre-work in a dataflow before writing the beast mode. Luckily, it isn't too tricky to do.
Here's a description of the Magic ETL dataflow:
Group the receiving data by "Order Number" and "Supplier", creating fields for Total Lines Received (SUM of Receiving Lines) and Date of First Receipt (MIN of Receipt Date) and then Join the result back onto the original data. Then we filter the data to distinguish between initial receipts and subsequent receipts and label them accordingly. Then we bring the data back together and output it. (See attached image for steps required).
Now you can create a beast mode for the Initial Fill Rate:
SUM(
CASE
WHEN `First Receipt` = 'TRUE' THEN `Receiving Lines`
ELSE 0
END
)
/
SUM(`Receiving Lines`)The second beast mode (Average Shipments to Complete Order) doesn't require any prework. It could be simply built like this:
COUNT(`Order Number`)
/
COUNT(DISTINCT `Order Number`)I hope that helps!
2 -
Thanks! Working through this now.
0 -
This request cannot be completed with a beast mode alone. Beast modes cannot perform functions to look accross multiple rows of data. You first need to add a field to your data set that will provide the First Receiving Day for each Order Number. I did this with an ETL:
I began by using your supplied data set as the input data set.
I then used the "Group By" action to create a new field, "First Receiving Day", for each Order Number:
Then you LEFT join the new field onto the original data set.
The Last step is to remove the duplicate fields with the Select Columns action and the create the output data set.
Now we can re-create your metrics using beast modes.
1: Receiving Lines
This is just the SUM of the field `Receiving Lines`
2: Lines Received First Receiving Day
This is a beast mode calculation.
sum(case when `Receipt Date` = `First Receiving Day` then `Receiving Lines` else 0 end)
3: Initial Fill Rate
Another Beast mode.
sum(case when `Receipt Date` = `First Receiving Day` then `Receiving Lines` else 0 end) / sum(`Receiving Lines`)
4: Receiving Events
count(`Receipt Date`)
5: Supplier Order Count
COUNT(DISTINCT `Order Number`)
6: Avg Shipments to Complete Order
(count(`Receipt Date`) / COUNT(DISTINCT `Order Number`))
As a side note, when you build the card, you will need to add the Supplier field to the Sorting section
2 -
For what it's worth, I like Scott's version better. Moving the checking for first receipt to the beast mode makes the dataflow simpler and as long as the data doesn't get too large, there shouldn't be a noticeable performance hit doing the calculation on the card instead of in the dataflow.
Nice work, Scott!
2 -
Thanks @zcameron
Also, for what it's worth... had I seen your post prior to working on this, I would have moved on to the next topic. ?
1 -
Nice work fellas, great to see this collaboration!
@ST_-Superman-_ great seeing you in SF at Dreamforce!
Keep up the good work, you too @zcameron!
Cheers!
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 302 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 104 SQL DataFlows
- 633 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 760 Beast Mode
- 62 App Studio
- 42 Variables
- 699 Automate
- 181 Apps
- 457 APIs & Domo Developer
- 51 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 401 Distribute
- 116 Domo Everywhere
- 277 Scheduled Reports
- 8 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 12 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 111 Community Announcements
- 4.8K Archive