<?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 Re: JMP Scripting Noob: How to input a new column based on filtering data from two columns? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JMP-Scripting-Noob-How-to-input-a-new-column-based-on-filtering/m-p/356798#M60683</link>
    <description>&lt;P&gt;You can fairly simply do this with Formulas in JMP by checking X and Y separately and concatenating them together.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Something like below should work (not that if the value is 0,5 or value over 10 it won't be categorized at all):&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If(0 &amp;lt; :y &amp;lt; 5, "L", 5 &amp;lt; :y &amp;lt; 10, "U") || If(0 &amp;lt; :x &amp;lt; 5, "L", 5 &amp;lt; :x &amp;lt; 10, "R")&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 07 Feb 2021 19:09:22 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2021-02-07T19:09:22Z</dc:date>
    <item>
      <title>JMP Scripting Noob: How to input a new column based on filtering data from two columns?</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-Scripting-Noob-How-to-input-a-new-column-based-on-filtering/m-p/356774#M60681</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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?&lt;/P&gt;&lt;P&gt;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)&amp;nbsp; based on the X and Y Coordinate...&lt;/P&gt;&lt;P&gt;So for example...&lt;/P&gt;&lt;P&gt;if 0&amp;lt;X&amp;lt;5 and 0&amp;lt;Y&amp;lt;5, label as LL&lt;/P&gt;&lt;P&gt;if 0&amp;lt;X&amp;lt;5 and 5&amp;lt;Y&amp;lt;10, label as UL&lt;/P&gt;&lt;P&gt;if 5&amp;lt;X&amp;lt;10 and 0&amp;lt;Y&amp;lt;5, label as LR&lt;/P&gt;&lt;P&gt;if 5&amp;lt;X&amp;lt;10 and 5&amp;lt;Y&amp;lt;10, label as UR&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am so lost, any help would be appreciated :)&lt;/img&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="schou1994_1-1612721805028.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/30068i50CECA60AE6A1DC9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="schou1994_1-1612721805028.png" alt="schou1994_1-1612721805028.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:25:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-Scripting-Noob-How-to-input-a-new-column-based-on-filtering/m-p/356774#M60681</guid>
      <dc:creator>schou1994</dc:creator>
      <dc:date>2023-06-10T23:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: JMP Scripting Noob: How to input a new column based on filtering data from two columns?</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-Scripting-Noob-How-to-input-a-new-column-based-on-filtering/m-p/356798#M60683</link>
      <description>&lt;P&gt;You can fairly simply do this with Formulas in JMP by checking X and Y separately and concatenating them together.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Something like below should work (not that if the value is 0,5 or value over 10 it won't be categorized at all):&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If(0 &amp;lt; :y &amp;lt; 5, "L", 5 &amp;lt; :y &amp;lt; 10, "U") || If(0 &amp;lt; :x &amp;lt; 5, "L", 5 &amp;lt; :x &amp;lt; 10, "R")&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 07 Feb 2021 19:09:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-Scripting-Noob-How-to-input-a-new-column-based-on-filtering/m-p/356798#M60683</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-02-07T19:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: JMP Scripting Noob: How to input a new column based on filtering data from two columns?</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-Scripting-Noob-How-to-input-a-new-column-based-on-filtering/m-p/356819#M60685</link>
      <description>&lt;P&gt;This can easily be done by finding which row has the different combinations of min and max values in the data table.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;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 &amp;lt;&amp;lt; new column("location", character, formula(
	:location[(dt &amp;lt;&amp;lt; get rows where(:x==col max(:x) &amp;amp; :y==col max(:y)))[1]]="UR";
	:location[(dt &amp;lt;&amp;lt; get rows where(:x==col max(:x) &amp;amp; :y==col min(:y)))[1]]="LR";
	:location[(dt &amp;lt;&amp;lt; get rows where(:x==col min(:x) &amp;amp; :y==col max(:y)))[1]]="UL";
	:location[(dt &amp;lt;&amp;lt; get rows where(:x==col min(:x) &amp;amp; :y==col min(:y)))[1]]="LR";
));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="minmax.PNG" style="width: 375px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/30073i7131A58345D54141/image-size/large?v=v2&amp;amp;px=999" role="button" title="minmax.PNG" alt="minmax.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 07 Feb 2021 19:25:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-Scripting-Noob-How-to-input-a-new-column-based-on-filtering/m-p/356819#M60685</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-02-07T19:25:00Z</dc:date>
    </item>
  </channel>
</rss>

