<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Updating column values in JSL in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Updating-column-values-in-JSL/m-p/53047#M30009</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data table consisting of coordinates X, Y and a column named Bin.&lt;/P&gt;&lt;P&gt;I would like to&amp;nbsp;keep the initial columns and transform those to new columns with coordinates called Xn and Yn.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you help me out?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();
Try(dt &amp;lt;&amp;lt; Delete column (:Xn)); //deletes existing Xn and Yn in case script is run several times
Try(dt &amp;lt;&amp;lt; Delete column (:Yn));
dt &amp;lt;&amp;lt; New Column ("Xn", Numeric, Continuous, Formula(:X));
dt &amp;lt;&amp;lt; New Column ("Yn", Numeric, Continuous, Formula(:Y));

New Window("DS Map Alignment",
	Button Box ("Mirror Y Axis",
		MirrorFunction)
);

MirrorFunction = Function({},
	NewX = :Xn &amp;lt;&amp;lt; Get Values();
	NewY = :Yn &amp;lt;&amp;lt; Get Values();
	dt:Xn &amp;lt;&amp;lt; Set Values (NewX);
	dt:Yn &amp;lt;&amp;lt; Set Values (-NewY); //This is where I mirror the Y coordinates
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 13 Mar 2018 07:50:28 GMT</pubDate>
    <dc:creator>PS</dc:creator>
    <dc:date>2018-03-13T07:50:28Z</dc:date>
    <item>
      <title>Updating column values in JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Updating-column-values-in-JSL/m-p/53047#M30009</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data table consisting of coordinates X, Y and a column named Bin.&lt;/P&gt;&lt;P&gt;I would like to&amp;nbsp;keep the initial columns and transform those to new columns with coordinates called Xn and Yn.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you help me out?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();
Try(dt &amp;lt;&amp;lt; Delete column (:Xn)); //deletes existing Xn and Yn in case script is run several times
Try(dt &amp;lt;&amp;lt; Delete column (:Yn));
dt &amp;lt;&amp;lt; New Column ("Xn", Numeric, Continuous, Formula(:X));
dt &amp;lt;&amp;lt; New Column ("Yn", Numeric, Continuous, Formula(:Y));

New Window("DS Map Alignment",
	Button Box ("Mirror Y Axis",
		MirrorFunction)
);

MirrorFunction = Function({},
	NewX = :Xn &amp;lt;&amp;lt; Get Values();
	NewY = :Yn &amp;lt;&amp;lt; Get Values();
	dt:Xn &amp;lt;&amp;lt; Set Values (NewX);
	dt:Yn &amp;lt;&amp;lt; Set Values (-NewY); //This is where I mirror the Y coordinates
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 07:50:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Updating-column-values-in-JSL/m-p/53047#M30009</guid>
      <dc:creator>PS</dc:creator>
      <dc:date>2018-03-13T07:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: Updating column values in JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Updating-column-values-in-JSL/m-p/53048#M30010</link>
      <description>&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;If I do not use Formula(:X), but&amp;nbsp; &amp;lt;&amp;lt; get values and &amp;lt;&amp;lt; set values instead, it works.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 07:56:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Updating-column-values-in-JSL/m-p/53048#M30010</guid>
      <dc:creator>PS</dc:creator>
      <dc:date>2018-03-13T07:56:20Z</dc:date>
    </item>
  </channel>
</rss>

