Subscribe Bookmark RSS Feed

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

ron_horne

Super User

Joined:

Jun 23, 2011

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

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson

Super User

Joined:

Jun 22, 2012

Solution

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
txnelson

Super User

Joined:

Jun 22, 2012

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

Joined:

Jun 23, 2011

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

 

txnelson

Super User

Joined:

Jun 22, 2012

Solution

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

Joined:

Jun 23, 2011

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