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.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
- 731 Beast Mode
- 55 App Studio
- 40 Variables
- 683 Automate
- 175 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
- 122 Manage
- 119 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 107 Community Announcements
- 4.8K Archive