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.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.8K Visualize
- 2.5K Charting
- 738 Beast Mode
- 56 App Studio
- 40 Variables
- 684 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 46 Workflows
- 10 DomoAI
- 35 Predict
- 14 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