JMP Scripting Noob: How to input a new column based on filtering data from two columns?Hi all,
I love JMP for it's graph building tools, so I am just starting to dabble in the scripting portion of it. Can someone help me with this request?
I have two cols. One for X coordinate and one for Y coordinate. All I want to do is simply create a new col that will list Upper Right/Upper Left/Lower Right/Lower Left (LL) based on the X and Y Coordinate...
So for example...
if 0<5 and 0<5, label as LL
if 0<5 and 5<10, label as UL
if 5<10 and 0<5, label as LR
if 5<10 and 5<10, label as UR
I am so lost, any help would be appreciated:)

Data TableScriptingRe: JMP Scripting Noob: How to input a new column based on filtering data from two columns?You can fairly simply do this with Formulas in JMP by checking X and Y separately and concatenating them together.
Something like below should work (not that if the value is 0,5 or value over 10 it won't be categorized at all):
If(0 < :y < 5, "L", 5 < :y < 10, "U") || If(0 < :x < 5, "L", 5 < :x < 10, "R")
Re: JMP Scripting Noob: How to input a new column based on filtering data from two columns?This can easily be done by finding which row has the different combinations of min and max values in the data table.
names default to here( 1 );
dt = New Table( "Sample",
Add Rows( 4 ),
New Column( "x",
Set Values( [1, 1, 6, 6] )
),
New Column( "y",
Set Values( [1, 6, 1, 6] )
)
);
dt << new column("location", character, formula(
:location[(dt << get rows where(:x==col max(:x) & :y==col max(:y)))[1]]="UR";
:location[(dt << get rows where(:x==col max(:x) & :y==col min(:y)))[1]]="LR";
:location[(dt << get rows where(:x==col min(:x) & :y==col max(:y)))[1]]="UL";
:location[(dt << get rows where(:x==col min(:x) & :y==col min(:y)))[1]]="LR";
));
