Lag a pre-existing column?
Hi there, I'm wondering if it's possible (with Magic ETL or beast mode) to creation functions (like rank and window) that can lag value from Column 1 to Column 2, where both columns already exist.
Full context:
We have 3 columns. Monthly total, Last month, Year to date. I'm trying to generate a new YTD total every month by adding the monthly total to last month's YTD. My current ETL process is recursive but I can't verify if it's working, and I'd like to remove any problem points.
ETL flow should look like [data/monthly total already present] > generate last month's total > add those two values together.
Generating last month's total is using rank and window with lag, currently, but because it's pulling from column 3, which doesn't have a value until after the rank and window step, so the reality is that it looks like:
[data/monthly total already present] > create blank YTD > generate last month's total (from YTD) > calculate actual YTD from those values > add the output to the beginning of the ETL flow, joining to the "create blank YTD" and populates the result from the previous run.
It just seems senselessly complicated, and I'm open to any other ideas of how we can do this creatively. It'd be great if the rank and window lag could drop the values of last month into a column that already exists, so I could put the addition function earlier in the ETL and remove the need for a recursive method. Month columns at the beginning are how totals are sorted, just YYYY-MM.
Best Answer
-
Disregard this question, found the answer in another post
2
Answers
-
Disregard this question, found the answer in another post
2
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