BookmarkSubscribe
Choose Language Hide Translation Bar
ron_horne
Super User

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

irr.png

 

 

0 Kudos
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

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.

ir3.PNG

ir1.PNG

 

ir2.PNG

Jim
4 REPLIES 4
txnelson
Super User

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
ron_horne
Super User

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

 

0 Kudos
txnelson
Super User

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.

ir3.PNG

ir1.PNG

 

ir2.PNG

Jim
ron_horne
Super User

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

0 Kudos