Two Group By with SUM totals
As always, terrible title by me I'm sure :)
This is quite similar to a question I had last week that @rco helped me with, and I'm using his answer as the basis for what I'm working on, but am stuck on getting it to work.
Last week I was doing counts of projects, but this week, I need to SUM the project cost. Simplified Input to Output mockup:
I'm not sure if I can actually use the same approach, but this is what I have. I've made adjustments to switch from count to SUM, and to the Planned Cost column, but I think the fake project ID and the correct for Dummy don't work here?
My output layout is at least correct, note that the column labeled Planned Cost is really a Total of the adjacent rows, but the values are missing or null:
Let me know if I can share any tile configs to help troubleshoot.
Thanks!
Best Answers
-
Hey PJG,
Here is what you will need to do:
this simple 2 step proccess will transform the input dataset provided into the output dataset.
I truncated the column names to make it easier for me to put this together.
Here are the truncated names that I used in my dataset:
0 -
You should be able to take the solution we did for Project Count with these changes:
1. Rename "ProjectId Const" tile to "Cost Const", name the constant "Planned Cost" instead of "Project Id", and make it zero instead of negative one.
2. In the Group By, do a Sum of "Planned Cost" instead of a Count Distinct of "Project Id".
3. Delete the "Correct for Dummy" tile, it isn't necessary (since our "dummy" is a cost of zero, which doesn't affect the sum at all so it doesn't need to be corrected).Randall Oveson <randall.oveson@domo.com>
1
Answers
-
Hey PJG,
Here is what you will need to do:
this simple 2 step proccess will transform the input dataset provided into the output dataset.
I truncated the column names to make it easier for me to put this together.
Here are the truncated names that I used in my dataset:
0 -
You should be able to take the solution we did for Project Count with these changes:
1. Rename "ProjectId Const" tile to "Cost Const", name the constant "Planned Cost" instead of "Project Id", and make it zero instead of negative one.
2. In the Group By, do a Sum of "Planned Cost" instead of a Count Distinct of "Project Id".
3. Delete the "Correct for Dummy" tile, it isn't necessary (since our "dummy" is a cost of zero, which doesn't affect the sum at all so it doesn't need to be corrected).Randall Oveson <randall.oveson@domo.com>
1
Categories
- All Categories
- 1.9K Product Ideas
- 1.9K Ideas Exchange
- 1.6K Connect
- 1.3K Connectors
- 302 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 104 SQL DataFlows
- 637 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 762 Beast Mode
- 65 App Studio
- 42 Variables
- 704 Automate
- 182 Apps
- 458 APIs & Domo Developer
- 53 Workflows
- 11 DomoAI
- 39 Predict
- 16 Jupyter Workspaces
- 23 R & Python Tiles
- 401 Distribute
- 116 Domo Everywhere
- 277 Scheduled Reports
- 8 Software Integrations
- 133 Manage
- 130 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