sum value from field from multiple rows
If I have a field 'amount' and am wanting to create sum the values from that field if there are multiple rows of the same order how cold I go about doing this.
So for example I have an order number of 0703915 and there are multiple rows with that order number but one row has an amount of -2000 and the other row has an amount of 2000, how can I sum this together, then only display one row for that order?
Comments
-
Hey Ryan!
The cardbuilder is going to be smart enough to combine rows with the same order number when you to a SUM aggregation on the value column. You shouldn't have to do anything else in the graph to get the rows rolled up in your visualzation, whether it's a table card or a bar graph.
To test this, create a table card and put the order number and value on the table. Then make sure the Value is aggregated to SUM. Once this is done, you should see one row per Order.
Let me know if this works or if I can provide additional detail!
**Say 'Thanks' by clicking the thumbs up in the post that helped you.
**Please mark the post that solves your problem as 'Accepted Solution'0 -
I set the 'amount' field to a sum aggregation but that didn't seem to have any effect I still have my multiple rows of orders with the different values....I'm wanting to sum those amounts together per order
0 -
Ryan,
The aggregation should have taken care of it. (See Screenshots). It's possible if the Order Number column has some hidden whitespace in one order number row but not the other, that could be causing the aggregation to not work.
Also if you have any other columns on the table (Such as two different product names) the graph will not roll up the rows into one because it's still grouping by unique product. The above solution will only work for order numbers that are the same and a value column. Any other unique columns added will not work.
I did a test, take a look at the order number and totals from before and after the SUM aggregation:
Before:
After:
**Say 'Thanks' by clicking the thumbs up in the post that helped you.
**Please mark the post that solves your problem as 'Accepted Solution'0 -
we do have other columns for these rows where their data is not the same for instance different dates, different invoice numbers
0 -
So in order to roll the rows up into a single row for each order, each column that you have must contain the same data. Any differences in any of the columns and the data will not combine into single rows.
This is because those rows of data are basally different rows of data.
Let me know if you have any additional questions!
**Say 'Thanks' by clicking the thumbs up in the post that helped you.
**Please mark the post that solves your problem as 'Accepted Solution'0 -
so for instance in my screenshot above each row must have the same blnum, etc.
0 -
Yes, exactly. That or you'd have to remove any columns that aren't alike.
**Say 'Thanks' by clicking the thumbs up in the post that helped you.
**Please mark the post that solves your problem as 'Accepted Solution'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