BookmarkSubscribe
Choose Language Hide Translation Bar

entering all values (rows) of a coulumn in a formula

Hi all,

need to enter all values of a column into another column formuma as in the picture below. what is the best way of doing this other than manually?

thanks!

ron 1 ACCEPTED SOLUTION

Accepted Solutions

Re: entering all values (rows) of a coulumn in a formula

The JSL I included is a formula.  Below are images of applying this to the Big Class data table, where I have changed the name of Height to Cash, and added a column called Column 6 where I added the JSL as the formula for it.   Jim
4 REPLIES 4

Re: entering all values (rows) of a coulumn in a formula

I would just read them in as a list or matrix

dt = Current Data Table();
v = dt:height << get values;
// or
v = As List( dt:height << get values );

Here is a complete version

Names Default To Here( 1 );
dt = Current Data Table();
v = As List( dt:cash << get values );
TheExpr = "x=internal rate of return(0.1";
For( i = 1, i <= N Items( v ), i++,
TheExpr = TheExpr || ", " || Char( v[i] )
);
TheExpr = TheExpr || ");";
Eval( Parse( TheExpr ) )
;
x;

Jim

Re: entering all values (rows) of a coulumn in a formula

Thank you Nelson, this does bring the answers neatly yet I was wondering if i could have it in the table itself so it will automatically update as i change the values in the cash column.

ron

Re: entering all values (rows) of a coulumn in a formula

The JSL I included is a formula.  Below are images of applying this to the Big Class data table, where I have changed the name of Height to Cash, and added a column called Column 6 where I added the JSL as the formula for it.   Jim

Re: entering all values (rows) of a coulumn in a formula

Thanks again, this is perfect.

Perhaps in a future version of JMP they will introduce a standard way of entering all values of a column in to a formula. It is actually useful in many applications.

What is more striking to me in this specific example using Big Class is that the internal rate of return of an all positive series comes out as negative!!! just makes you wonder what is in the "black box"

Ron