cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Image to Table JMP extension imports single or batch images as data tables. Useful to extract curves from pictures or convert image data to curve data to use in analyses like Functional Data Explorer. Download and install the extension.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
AC_AC
Level I

How to apply a column formula on only a range of rows and not every row?

Hi,

 

I am trying to create a column formula that calculates the mean of every 5 rows (for a specific column). 

Normally the formula are applied to every row using values in such row. Instead, I would like to use values from 5 previous row to calculate a mean value.

I am been playing with the formula editor and try to use the Row() and other functions, but without success. 

 

Thanks a lot to anyone who can help me out.

 

BR

AC_AC

 

Mean5RowProblem.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: How to apply a column formula on only a range of rows and not every row?

For Mean I would suggest using Col Moving Average

If(Modulo(Row(), 3) == 0,
	Col Moving Average(:Col, 1, 2, 0),
	.
)

jthi_0-1657882865907.png

Otherwise Data table subscripting might be helpful

If(Modulo(Row(), 3) == 0,
	Mean(:Col[Index(Row() - 2, Row())])
)
-Jarmo

View solution in original post

1 REPLY 1
jthi
Super User

Re: How to apply a column formula on only a range of rows and not every row?

For Mean I would suggest using Col Moving Average

If(Modulo(Row(), 3) == 0,
	Col Moving Average(:Col, 1, 2, 0),
	.
)

jthi_0-1657882865907.png

Otherwise Data table subscripting might be helpful

If(Modulo(Row(), 3) == 0,
	Mean(:Col[Index(Row() - 2, Row())])
)
-Jarmo

Recommended Articles