cumulative sum
Is it possible to have a cumulative sum for values in one column to show in another so that the final today would be in the last row? ex. in the attached screenshot If I wanted to have Total Revenue cumulatively sum and show each new value in a column next to it so the in the first row of 'Cumulative Sum' would be 19075 and the second row would be 19075+8724218.03, in the third would be 19075+8724218.03+66363.24, etc
My hope is then if I can generate this then create another beastmode to have the max of the column cumulative sum so that I would just have the grand total
thanks
Best Answer
-
is `Total Revenue` ever null?
try
IFNULL(`Total Revenue`,0) / (SUM(IFNULL(`Total Revenue`,0)) OVER())
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman0
Answers
-
I'm not sure if you can do it in a beastmode or not but you can achieve something like that you're looking for in an ETL.
Use the Rank & Window block with a function of SUM based on your Total Revenue field and make it unbounded with a preceeding of 0.
When I look just at those columns you can see it's a running total.
**Make sure to like any users posts that helped you and accept the ones who solved your issue.**1 -
@meadow_ryan - I'm trying to understand your use case. You want to calculate a running total so that you can take the max() of that field to get a grand total?
Unless there is more to this, why not just sum the column?
If the intention is to understand what percentage of total revenue is coming from each company, you can to this using beastmodes.
For `Grand Total (Revenue)`
(sum(`Total Revenue`) over ())
for % of revenue
`Total Revenue` / (sum(`Total Revenue`) over ())
This will give you something like this:
The advantage to doing this in the beastmode is that the grand total and the percentage will recalculate as you apply any filters to the card
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman0 -
I added the following to my card and the card doesn't display any data now
`Total Revenue`/(sum(`Total Revenue`) over ())
0 -
-
is `Total Revenue` ever null?
try
IFNULL(`Total Revenue`,0) / (SUM(IFNULL(`Total Revenue`,0)) OVER())
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman0 -
don't believe it ever will be, but when I add the beast mode function receive the following in the screenshot
0 -
You need to make sure that none of the other fields are aggregate functions as well.
I'm guessing that =Profit is an aggregate field. Try taking it off or removing the aggregate from the beastmode formula
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman0 -
=Profit is
SUM(`Total Revenue` - ABS(`Total Cost`))
0 -
change it to:
`Total Revenue` - ABS(`Total Cost`)
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman0 -
-
change the field to display as a percent with 2 decimals
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 296 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 614 Datasets
- 2.2K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 729 Beast Mode
- 53 App Studio
- 40 Variables
- 677 Automate
- 173 Apps
- 451 APIs & Domo Developer
- 45 Workflows
- 8 DomoAI
- 34 Predict
- 14 Jupyter Workspaces
- 20 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 121 Manage
- 118 Governance & Security
- Domo Community Gallery
- 32 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive