ETL Calculation
Hello,
I have SO dataset and want to create a calculated field that would show the sum of the items within an order. To give an example, I have an order that has 5 rows of information (5 different items), I want to create another field that would sum up the cost of the items and create another field that would show the same value for those rows? ex. items cost 2,2,3,3,4. I want to have another field that would show that based on the order number, the sum is 14. Any ideas what transformations I need to create?
Answers
-
@zuchu You will want to use a Rand & Window tile:
You'll do a sum of the costs and partition by the order number. This will give you the total of the order on each row that the order number appears.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**
1 -
@RobSomers Can you walk me through the process?
I created a new column name, then applied sum as a function based on the COST column, then not sure what to put as a frame range to be used??
Later I assume column to order on functions on is my order number, ascending/descending and should i do anything with 'what columns make up the partition'?
0 -
My approach would be to use a group by tile here. I would group your orders by whatever your unique identifier is for a single order (the one with 5 items in this case). I'll call this field
OrderID
for demonstration purposes.You would use a group by tile and group the data by
OrderID
. You would then add an aggregate field that would be the SUM ofCost
field. You could call this fieldTotalCost
Next, you join this back to your original data (join on
OrderID
). This will add a column to your original table that would be calledTotalCost
and would be the sum of allCost
within a singleOrderID
@RobSomers I would recommend using rank and window tiles when you need a running total.
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
- 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
- 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