Beastmode for multiple row comparisons to one source row?
I'd like to add a third column in a table visualization that displays the % change for the current week to each previous period listed.
What's the best way to create a beast mode for this?
Best Answer
-
If those are your only records in your dataset you can utilize a Magic ETL to add a constant to your dataset (Join Column, value 1), then filter your data for just 'Current Week'. Take that filter and join it back to your original dataset with the constant and join both on the constant. This will join each row to the current week record for you to compare the two values together.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**1
Answers
-
I'd suggest creating a Magic ETL flow and using the Lead Window function.
Here's how to do this:
- Connect the Window Function tile to your dataset in the Magic ETL.
- Here you will use the Lead function and will run the function on the column SCOGS with an offset of 1
- Next, you will order your function on the "Period" column and choose ascending.
Now, you have the previous period on the same row as the period before so that you can perform the row-wise calculation needed to get the % change column you were looking for.
Let me know if you have any further questions or need any additional help. Merry Christmas!
0 -
Hi Travor!
Thanks for your reply and explanation. Apologies, I might not have explained this clearly enough. This sort of solution seems like the right path to me, though.
I want to compare every period with the current week.
So, in the example you created, the third column would read 222405 for every row.
What's the best way to do that?
(And an early Happy New Year to you!)
0 -
If those are your only records in your dataset you can utilize a Magic ETL to add a constant to your dataset (Join Column, value 1), then filter your data for just 'Current Week'. Take that filter and join it back to your original dataset with the constant and join both on the constant. This will join each row to the current week record for you to compare the two values together.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**1 -
Brilliant! Thank you.
I was making this too complicated trying to figure out a way to make a dynamic constant. This is perfect. 👌
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