- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Moving Average
I have a table called drugs with columns drug and result, how do I calculate the moving average of the result column by taking the first 4 rows followed by the next 4 rows and similarly continue. Pfa the sample table for reference.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Moving Average
The formula to use is
If( Mod( Row(), 4 ) == 0,
Mean( :Result[Index( Row() - 3, Row() )] )
)
I have attached your example data table, with a new column with the formula in it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Moving Average
hello ,
you can try with Formula column --> row --> moving average
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Moving Average
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Moving Average
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Moving Average
I want to generate the moving average column as shown in the attached table, for every 4 rows I need to calculate the average
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Moving Average
The formula to use is
If( Mod( Row(), 4 ) == 0,
Mean( :Result[Index( Row() - 3, Row() )] )
)
I have attached your example data table, with a new column with the formula in it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Moving Average
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Moving Average
I think this will give you the moving average that you want (4 rows before and 4 rows after).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Moving Average
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Moving Average
Create a new column in your data table, and apply the folloing formula
Col Moving Average( :Result, weighting = 1, before = 3, :Drug )