cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
PS
PS
Level III

Updating column values in JSL

Hi,

 

I have a data table consisting of coordinates X, Y and a column named Bin.

I would like to keep the initial columns and transform those to new columns with coordinates called Xn and Yn.

 

Then I have a window with a button box that calls a function that mirrors the Y-coordinates. When I push the button, the command works, but just for a split second, before the coordinates are turned back to their initial values. I just see a short flash with the reversed sign.

 

Can you help me out?

 

Thanks for your help

 

dt = Current Data Table();
Try(dt << Delete column (:Xn)); //deletes existing Xn and Yn in case script is run several times
Try(dt << Delete column (:Yn));
dt << New Column ("Xn", Numeric, Continuous, Formula(:X));
dt << New Column ("Yn", Numeric, Continuous, Formula(:Y));

New Window("DS Map Alignment",
	Button Box ("Mirror Y Axis",
		MirrorFunction)
);

MirrorFunction = Function({},
	NewX = :Xn << Get Values();
	NewY = :Yn << Get Values();
	dt:Xn << Set Values (NewX);
	dt:Yn << Set Values (-NewY); //This is where I mirror the Y coordinates
);

 

1 ACCEPTED SOLUTION

Accepted Solutions
PS
PS
Level III

Re: Updating column values in JSL

Alright... one again I realize what I had done seconds after I post. The columns Xn and Yn are defined via a formula in rows 4 and 5. This formula overrides the "set values" command.

If I do not use Formula(:X), but  << get values and << set values instead, it works.

View solution in original post

1 REPLY 1
PS
PS
Level III

Re: Updating column values in JSL

Alright... one again I realize what I had done seconds after I post. The columns Xn and Yn are defined via a formula in rows 4 and 5. This formula overrides the "set values" command.

If I do not use Formula(:X), but  << get values and << set values instead, it works.