How to use a value in previous line of table
I know this could be done in the SQL code and brought in with my table, but hoping it can be dne in beast mode as hat would allow for greater flexibility.
I have a table - (sample below) - Assume it is April 15th - end of the day (50%) of the way thoguh month.
DateOne, Plan and Actual all are pulled in from an SQL query. Forecast1 is a Beast Mode Calculation that looks at the days of the current paste and adjusts the actual to a straightline based on number of days in month. In the example below we are 50% of the way through the month so the number doubles.
Forecast2 is the one I cannot figure out. I would like to take either the Actual from the current month or Forcast1 from current monthas a starting point to do a clcultion in later months. In the table below, for example, it takes the April Actual of 15 and multiplies by 1. I can get the Beast mode to identify the month correctly and i can hard code a 15 into the outer months, but i cannot figure out how to pull the 15 from April actual to use it in other row calculations. In short, i can do the whole table below other than than the numbers in RED based on a calculation. Can it be done in Beast Mode?
DateOne | Plan | Actual | Forecast1 | Forecast2 |
1/1/2015 | 20 | 15 | ||
2/1/2015 | 20 | 18 | ||
3/1/2015 | 20 | 25 | ||
4/1/2015 | 22 | 15 | 30 | |
5/1/2015 | 22 | 15 | ||
6/1/2015 | 22 | 15 | ||
7/1/2015 | 25 | 15 | ||
8/1/2015 | 25 | 15 | ||
9/1/2015 | 25 | 15 | ||
10/1/2015 | 25 | 15 | ||
11/1/2015 | 27 | 15 | ||
12/1/2015 | 27 | 15
|
** Please like responses by clicking on the thumbs up
** Please Accept / check the answer that solved your problem / answered your question.
Comments
-
Good question. The short answer is that you cannot do this calculation with Beast Mode.
Think of the card builder as a point and click SQL query designer. The SQL query you are designing does not allow for joins or subqueries and in many cases has an implied GROUP BY statement (depending on the rest of the settings in your card).
In this case I'm pretty sure you need a subquery to get the actual value from April (15 in this example) so you can pull it into the other rows.
-----
I work for Domo.
**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 -
So it can't be done in Beat Mode, but it can be done as part of a Magic Transformation? What would be the most performant way of doing that across multiple categories and c80m rows please?
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.9K Visualize
- 2.5K Charting
- 738 Beast Mode
- 57 App Studio
- 40 Variables
- 685 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 47 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 124 Manage
- 121 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