<?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 Basics - how to assign column values in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JMP-Basics-how-to-assign-column-values/m-p/38641#M22613</link>
    <description>&lt;P&gt;Thank you for the quick response! I like solution 1 better and that was what I was looking for.&lt;/P&gt;&lt;P&gt;To get to a step further, my data looks like this and i have to define 2 conditional statements for 2 different scenarios.&lt;/P&gt;&lt;P&gt;1. When data has only 1 A corner at the center of the square&lt;/P&gt;&lt;P&gt;2. When data has 2 points at the center call them: A-Top and A-bottom (with the same X-cordinate)&lt;/P&gt;&lt;P&gt;Depending on the data present in the data table, I am trying to write the script to name the corners like below (in that order).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;X1&lt;/TD&gt;&lt;TD&gt;Y1&lt;/TD&gt;&lt;TD&gt;Corners&lt;/TD&gt;&lt;TD&gt;Y1&lt;/TD&gt;&lt;TD&gt;Y2&lt;/TD&gt;&lt;TD&gt;Corners&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;-70&lt;/TD&gt;&lt;TD&gt;29102&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;-25&lt;/TD&gt;&lt;TD&gt;26338&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1569&lt;/TD&gt;&lt;TD&gt;-18&lt;/TD&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;1615&lt;/TD&gt;&lt;TD&gt;-18&lt;/TD&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;9202&lt;/TD&gt;&lt;TD&gt;15299&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;&lt;FONT face="arial black,avant garde"&gt;9264&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;9272&lt;/TD&gt;&lt;TD&gt;A-Bottom&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;14784&lt;/TD&gt;&lt;TD&gt;30692&lt;/TD&gt;&lt;TD&gt;D&lt;/TD&gt;&lt;TD&gt;&lt;FONT face="arial black,avant garde"&gt;9264&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;18563&lt;/TD&gt;&lt;TD&gt;A-Top&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;16424&lt;/TD&gt;&lt;TD&gt;1572&lt;/TD&gt;&lt;TD&gt;E&lt;/TD&gt;&lt;TD&gt;15585&lt;/TD&gt;&lt;TD&gt;27929&lt;/TD&gt;&lt;TD&gt;D&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;17226&lt;/TD&gt;&lt;TD&gt;1572&lt;/TD&gt;&lt;TD&gt;E&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;If you can share the script, it would be helpful.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Sat, 29 Apr 2017 05:40:32 GMT</pubDate>
    <dc:creator>jrintaz</dc:creator>
    <dc:date>2017-04-29T05:40:32Z</dc:date>
    <item>
      <title>JMP Basics - how to assign column values</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-Basics-how-to-assign-column-values/m-p/38610#M22595</link>
      <description>&lt;P&gt;hi, i am new to JMP. i have a data set that defines the co-ordinates of a sqaure. Column X contains co-ordinates x-dierction and column Y has the co-orniates in y direction. I want to name the corners B,C,D,E clockwise and the cenetr of the square A in the data table only and dont want to create any graph/picture&lt;/P&gt;&lt;P&gt;Can anyone help with a JSL script?&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2017 03:56:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-Basics-how-to-assign-column-values/m-p/38610#M22595</guid>
      <dc:creator>jrintaz</dc:creator>
      <dc:date>2017-04-28T03:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: JMP Basics - how to assign column values</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-Basics-how-to-assign-column-values/m-p/38612#M22596</link>
      <description>&lt;P&gt;I am not sure what you actually are looking for, but if the table below is it, the script following the table will generate the corner names&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="corner table.PNG" style="width: 533px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/6011iB5AA830FEAAE2E82/image-size/large?v=v2&amp;amp;px=999" role="button" title="corner table.PNG" alt="corner table.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();
dt &amp;lt;&amp;lt; New Column( "Corner Name", character );
dt:Corner Name[dt &amp;lt;&amp;lt; get rows where( :x == Col Min( :x ) &amp;amp; :y == Col Min( :y ) )] = "B";
dt:Corner Name[dt &amp;lt;&amp;lt; get rows where( :x == Col Min( :x ) &amp;amp; :y == Col Max( :y ) )] = "C";
dt:Corner Name[dt &amp;lt;&amp;lt; get rows where( :x == Col Max( :x ) &amp;amp; :y == Col Max( :y ) )] = "D";
dt:Corner Name[dt &amp;lt;&amp;lt; get rows where( :x == Col Max( :x ) &amp;amp; :y == Col Min( :y ) )] = "E";
dt:Corner Name[dt &amp;lt;&amp;lt; get rows where( :x == Col Mean( :x ) &amp;amp; :y == Col Mean( :y ) )] = "A";
// OR
dt &amp;lt;&amp;lt; New Column( "Corner Name 2", character );
dt:Corner Name 2[1] = "B";
dt:Corner Name 2[2] = "C";
dt:Corner Name 2[3] = "D";
dt:Corner Name 2[4] = "E";
dt:Corner Name 2[5] = "A";
// OR
dt &amp;lt;&amp;lt; New Column( "Corner Name  3", character, values({"B","C","D","E","A"}) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 28 Apr 2017 12:05:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-Basics-how-to-assign-column-values/m-p/38612#M22596</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-04-28T12:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: JMP Basics - how to assign column values</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-Basics-how-to-assign-column-values/m-p/38641#M22613</link>
      <description>&lt;P&gt;Thank you for the quick response! I like solution 1 better and that was what I was looking for.&lt;/P&gt;&lt;P&gt;To get to a step further, my data looks like this and i have to define 2 conditional statements for 2 different scenarios.&lt;/P&gt;&lt;P&gt;1. When data has only 1 A corner at the center of the square&lt;/P&gt;&lt;P&gt;2. When data has 2 points at the center call them: A-Top and A-bottom (with the same X-cordinate)&lt;/P&gt;&lt;P&gt;Depending on the data present in the data table, I am trying to write the script to name the corners like below (in that order).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;X1&lt;/TD&gt;&lt;TD&gt;Y1&lt;/TD&gt;&lt;TD&gt;Corners&lt;/TD&gt;&lt;TD&gt;Y1&lt;/TD&gt;&lt;TD&gt;Y2&lt;/TD&gt;&lt;TD&gt;Corners&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;-70&lt;/TD&gt;&lt;TD&gt;29102&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;-25&lt;/TD&gt;&lt;TD&gt;26338&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1569&lt;/TD&gt;&lt;TD&gt;-18&lt;/TD&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;1615&lt;/TD&gt;&lt;TD&gt;-18&lt;/TD&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;9202&lt;/TD&gt;&lt;TD&gt;15299&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;&lt;FONT face="arial black,avant garde"&gt;9264&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;9272&lt;/TD&gt;&lt;TD&gt;A-Bottom&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;14784&lt;/TD&gt;&lt;TD&gt;30692&lt;/TD&gt;&lt;TD&gt;D&lt;/TD&gt;&lt;TD&gt;&lt;FONT face="arial black,avant garde"&gt;9264&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;18563&lt;/TD&gt;&lt;TD&gt;A-Top&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;16424&lt;/TD&gt;&lt;TD&gt;1572&lt;/TD&gt;&lt;TD&gt;E&lt;/TD&gt;&lt;TD&gt;15585&lt;/TD&gt;&lt;TD&gt;27929&lt;/TD&gt;&lt;TD&gt;D&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;17226&lt;/TD&gt;&lt;TD&gt;1572&lt;/TD&gt;&lt;TD&gt;E&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;If you can share the script, it would be helpful.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 29 Apr 2017 05:40:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-Basics-how-to-assign-column-values/m-p/38641#M22613</guid>
      <dc:creator>jrintaz</dc:creator>
      <dc:date>2017-04-29T05:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: JMP Basics - how to assign column values</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-Basics-how-to-assign-column-values/m-p/38645#M22615</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="corners 1.PNG" style="width: 254px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/6019iEDD7D7BB75E7900B/image-dimensions/254x233?v=v2" width="254" height="233" role="button" title="corners 1.PNG" alt="corners 1.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="corners 2.PNG" style="width: 250px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/6020iC978274BB30DB044/image-dimensions/250x235?v=v2" width="250" height="235" role="button" title="corners 2.PNG" alt="corners 2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The new data you provided do not meet the assumptions that I had made in creating the original scripts I provided. &amp;nbsp;I had assumed a square, with the X and Y coordinates being definable by examining the extreme values and for center points, the true center(mean). &amp;nbsp;You had also indicated the corners would be in a clockwise order, (B,C,D,E). &amp;nbsp;As can be seen in the graphs above, that also is no longer true. &amp;nbsp;Therefore, the only solution I can see is to hardcode the values for the corners.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();
If(
	Col Number( dt:x1 ) == 5,
		dt &amp;lt;&amp;lt; New Column( "Corners", Character, values( {"B", "C", "A", "D", "E"} ) ) //
, // Else
	Col Number( dt:x1 ) == 6,
		dt &amp;lt;&amp;lt; New Column( "Corners",
			Character,
			values( {"B", "C", "A-Bottom", "A-Top", "D", "E"} )
		)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Apr 2017 11:27:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-Basics-how-to-assign-column-values/m-p/38645#M22615</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-04-29T11:27:57Z</dc:date>
    </item>
  </channel>
</rss>

