Beast Model for Calculating Average of Values for lines which meets certain conditions
I have looked through several posts to see if this was already discussed, but couldn't didn't quite find what I was looking for.
I have a dataset that contains a date column representing the week for which the data is for. I would like to calculate the average of values within a 6 week period from the original date that meets certain conditions. I would like to calculate this for every row in my dataset.
For data in row 1: I would like to get the average of values from rows 2 - 7 (not because it is the sequential row number but because those are the weeks within a 6 week period), excluding row 4 and 7 (because Event field= Y).
For data in row 2: I would like to get the average of values from rows 3 - 8, excluding row 4 and 7 in the calculation
For data in row 8: I would get the average of values from rows 9 - 14, no exclusions since all these records for Event field = N
Can someone provide some guidance on how I might be able to approach this in beast mode? Thanks!
- 7.3K All Categories
- 13 Getting Started in the Community
- 142 Beastmode & Analytics
- 1.8K Data Platform & Data Science
- 54 Domo Everywhere
- 2K Charting
- 1K Ideas Exchange
- 904 Connectors
- 237 Workbench
- 342 APIs
- 77 Apps
- 19 Governance & Productivity
- 235 Use Cases & Best Practices
- 50 News
- 473 Onboarding
- 573 日本支部