Aggregation on Lag/Lead functions
I used the Lag function to operate a subtraction between data point and previous data point. However now I need now the average for that new column (which I am not able to do in Beast Mode)
Any suggestions
Comments
-
This isn't possible as you can't aggregate a window function within a beast mode. What you'd need to do is perform your lag in an ETL and then calculate the average in your card. You may lose some filtering abilities as it's going to be pre-aggregated.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**2 -
Thanks for the info Grant
Are you aware of any other type of statistical functions as Standard deviation within (not overall) or ppk / cpk parameters? I am actually doing this in order to manually calculate it
0 -
And do you have any tutorial on how to do it with ETL
0 -
You can utilize a Rank & Window tile (see https://domohelp.domo.com/hc/en-us/articles/360044876094-Magic-ETL-Tiles-Aggregate#3.) within Magic ETL to select the LAG value of your column.
Domo does offer a Data Science suite of tiles which includes the outlier detection tile to calculate standard deviation but this is a premium feature. https://domohelp.domo.com/hc/en-us/articles/360045259294-Magic-ETL-Tiles-Data-Science#h_11ce7566-b3c0-486c-950e-63743079b9df
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0 -
sorry for showing up late to the party. the problem isn't that you can't aggregate a window function as @GrantSmith suggests.
I believe the issue is that you're trying to perform math on an aggregation and an unaggregated value (column11) in your example.
you SHOULD be able to write
lag(sum(col_11), 1) over( order by date desc ) - sum(col_11)
but you CANNOT write
lag(sum(col_11), 1) over( order by date desc ) - col_11
because col_11 in example 2 only exists pre-aggregation. and your lag() function applies after aggregation , sum(col_11)
the ABS has nothing to do with the error. this should work fine.
abs( lag(sum(col_11), 1) over( order by date desc ) - sum(col_11) )
Jae Wilson
Check out my 🎥 Domo Training YouTube Channel 👨💻
**Say "Thanks" by clicking the ❤️ in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"1 -
Thank you for the help. I will try that way
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