How to get a formula column by row sub groupHi there,
I d like to create a formula column (sum or mean etc.) with sub groups. The sub groups should be selected by rows, for example all 5 following rows drom a data table or in general all N rows. Any ideas to solve this with row()?
Attache a file to add the formula column.
Re: How to get a formula column by row sub groupThanksRe: How to get a formula column by row sub groupAs I understand it, Local() simply let variables to be defined and evaluated within the context of the column formula, eliminating risk of interference with global variables with the same name. Parameters are used in optimization problems, i.e. the nonlinear platform.
Re: How to get a formula column by row sub groupHi ms,
Thanks for the update. The local approach delivers the results, without error code from the formula editor.
By the way, what is the difference between Parameter() and local()?
Re: How to get a formula column by row sub groupNot sure why you see this error message. You could try updating to the latest version to see if it helps. But, you could hard code the value of n to avoid the variable in the formula if the number is constant.
Or try with Local() instead of Parameter() (which actually is what I intended in my first post).
Local({n = 5}, Col Sum(:Data, Ceiling(Row() / n)))Re: How to get a formula column by row sub groupThanks Jim. Your formual works also. However, similar to the solution from ms I'm getting the error code from the formula editor for n "Error: Name Unresolved: n", despite the formual is working (JMP 14.0)
Re: How to get a formula column by row sub grouptry
n = 5; Col Sum(:Data, Ceiling(Row() / n))
Re: How to get a formula column by row sub groupHi ms,
Thanks for your support. Your formula works great. Despite the formula delviers the approriate reuslts, the formal editor is marking n red in the formul part:
( Row() / n ) ) )
and delievers an error code. The error code is "Error: Name Unresolved: n". Are there any reasons to be concerned?
Re: How to get a formula column by row sub groupAttached a sample file with a new column "Sum_of_each_5_Data_rows". This shows the sum of sub groups build from every 5 rows (N=5) of the data column.
How could this be done by using any given row numbers for the subgroup to create column formulas like Col Sum, Col Mean, Col Min etc.
Re: How to get a formula column by row sub groupTry using a Row() transformation as optional ByGroup argument of the "Col Stat()" functions.
For example:
Parameter({n = 5}, Col Sum(:Data, Ceiling(Row() / n)))Re: How to get a formula column by row sub groupThat is a bit confusing......could you provide a sample table?Re: How to get a formula column by row sub groupHi Jim,
Thanks for your fast response. Actually I'm looking for column formulas for row sub groups (for example row1 1-5, row1 6-10 ..., in general row 1-n, row n+1 - 2n, row 2n+1 - 3n...), where I can apply the column formulas from JMP.Re: How to get a formula column by row sub groupThe Col Moving Average() function is what you need to use.
For your averaging the formula would be:
Col Moving Average( :Data, 1, 0, 5 )
To calculate the sum it would be
Col Moving Average( :Data, 1, 0, 5 ) * 6
Documentation on the function is found in the Scripting Index
Help==>Scripting Index
look for Statistical Functions