Previous Row + Following Row: Cumulative Sum
Previously, I was provided a video to help with receive this result, but didn't realize that performing it in View Explorer didn't quite work, so I sadly had to create an thread for the same question.
Using Magic ETL I would like to find a way to take the previous row + the following row, keep the sum and continue to add the following row to the sum.
What I will eventually be able to do, is perform an 80-20 analysis. Typically, I would do this in excel, but I wanted to see if it can be accomplished in DOMO. I attached an example doc complete with my formulas still attached, in hopes that it would help.
What I would like to do is like the following:
Example:
Table
Date Name Value Result
10/01/20 A 1 1
10/01/20 B 2 3
10/01/20 C 3 5
11/01/20 D 1 1
11/01/20 E 2 3
11/01/20 F 3 5
Setting the preceding to unbounded and following to 1, I was able to achieve the results I wanted but with one teeny tiny issue: those first values:
Originally, there was an answer to do this in views explorer, but the issue with using view explorer is that it didn't treat my values as unique and just gave me a lump sum. When I export it, I lose all the rest of my columns and have to return and join it back in in magic ETL.
So I'm hoping for is how to get percentile rank in magic etl (only).
Super sorry for the repeated question. I intend to use the report to complete my result using the Analyzer, so completing it in Beastmode woke work since I'll need to filter on it.
Best Answer
-
Taking your sample excel file from https://dojo.domo.com/discussion/comment/53717/#Comment_53717 and as they mentioned in that ticket, you can take the cumulative sum taking unbounded to 0 following to calculate the running total then divide that by the overall total to get your contribution percentage.
I've attached the JSON representation of the dataflow I used to calculate this. You can copy this text and then paste it into a Magic ETL 2.0 dataflow.
Here's a screen shot of what it'll look like:
Here's a sample of the output:
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0
Answers
-
Taking your sample excel file from https://dojo.domo.com/discussion/comment/53717/#Comment_53717 and as they mentioned in that ticket, you can take the cumulative sum taking unbounded to 0 following to calculate the running total then divide that by the overall total to get your contribution percentage.
I've attached the JSON representation of the dataflow I used to calculate this. You can copy this text and then paste it into a Magic ETL 2.0 dataflow.
Here's a screen shot of what it'll look like:
Here's a sample of the output:
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0 -
Wow that works great! I changed some things around and was able to get the cumulative sum using your JSON script.
Thanks so much for your help, really appreciate it.
0
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