Beast Mode Calculation Help Needed
I need to create a new Column via Beast mode called % Sales Material based on the following calculation.
(Sales Price - Actual Cost) / Sales Price
I am struggling with the exact Beast Mode Code because Sales Price is on one Line Based on WTSTEP 000 And Actual Cost is on a Separate Line and is based on Beast Mode Where when WTSTEP = 010 it will take 'UnitCost' * 'QTY Ordered'
Best Answers
-
I see in your example that the 3 entries share the same SO#, so would the % you're trying to calculate be at the SO# level? if that is the case if you display your card by SO# instead of WTSTEP a formula like the one below might get you what you need:
SUM(`Sales Price`- `Actual Cost`)/SUM(`Sales Price`)
If for some reason you'd need to display things at the WTSTEP level but still need the same percentage to show on each line for the same SO#, you'd need to use a FIXED function to do this for you, something like:
SUM(SUM(`Sales Price`- `Actual Cost`) FIXED (BY `SO#`))/SUM(SUM(`Sales Price`) FIXED (BY `SO#`))
Hope this helps, (I'm guessing
Actual Cost
would be the addition of the 4 columns you have with the Cost word in them, so you'd need to put those in parenthesis and add them instead).1 -
I think your beast mode calculation should be as below.
(SUM
(`Sales Price`) - SUM(`Actual Cost`))/
SUM
(`Sales Price`)
Try and let us know.
1
Answers
-
Update / FYI the Sale Price is a Single Line Field where as Actual Material Cost is multiple lines Summed within Card. This is what is causing me frustration / confusion.
0 -
I see in your example that the 3 entries share the same SO#, so would the % you're trying to calculate be at the SO# level? if that is the case if you display your card by SO# instead of WTSTEP a formula like the one below might get you what you need:
SUM(`Sales Price`- `Actual Cost`)/SUM(`Sales Price`)
If for some reason you'd need to display things at the WTSTEP level but still need the same percentage to show on each line for the same SO#, you'd need to use a FIXED function to do this for you, something like:
SUM(SUM(`Sales Price`- `Actual Cost`) FIXED (BY `SO#`))/SUM(SUM(`Sales Price`) FIXED (BY `SO#`))
Hope this helps, (I'm guessing
Actual Cost
would be the addition of the 4 columns you have with the Cost word in them, so you'd need to put those in parenthesis and add them instead).1 -
I tried your first solution but the answer is not correct. I am getting 49% when I do the simple math in Excel. Here it is showing 39% ????
0 -
Excel Calculation is not matching Calculation in DOMO. Used this calculation.
SUM(SUM(`Sales Price`- `Actual Cost`) FIXED (BY `SO#`))/SUM(SUM(`Sales Price`) FIXED (BY `SO#`))
0 -
I think your beast mode calculation should be as below.
(SUM
(`Sales Price`) - SUM(`Actual Cost`))/
SUM
(`Sales Price`)
Try and let us know.
1 -
Marcel, I found the issue on this. I had two different numbers labor and
material being represented by a single field jt158_WTExtendedCost that
are differentiated by the WT#. I created a Function in the ETL to break
this out and I was able to get it to work with your second formula.
Thank you for your assistance.SUM(SUM(`Sales Price`- `Actual Cost`) FIXED (BY `SO#`))/SUM(SUM(`Sales Price`) FIXED (BY `SO#`))
1
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
- 754 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