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.
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman1
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
- 56 App Studio
- 40 Variables
- 684 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 46 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 123 Manage
- 120 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