<?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: Comparing row values in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Comparing-row-values/m-p/53160#M30094</link>
    <description>deleted my response because I realized I didn’t answer the right question</description>
    <pubDate>Thu, 15 Mar 2018 06:41:19 GMT</pubDate>
    <dc:creator>cwillden</dc:creator>
    <dc:date>2018-03-15T06:41:19Z</dc:date>
    <item>
      <title>Comparing row values</title>
      <link>https://community.jmp.com/t5/Discussions/Comparing-row-values/m-p/53157#M30093</link>
      <description>&lt;P&gt;I have a table which has 2 columns Term and Multiply which looks something like this:&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="Capture1.PNG" style="width: 441px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9847i2668DDCB08CBCFB9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture1.PNG" alt="Capture1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I want to somehow be able to read the column "Term" and check the following:&lt;/P&gt;&lt;P&gt;1) If the term in the "Term" column is not multiplied by anything (like Name, Place, Animal and Thing in the above table), then multiply the value in the "Multiply" column by 2.&lt;/P&gt;&lt;P&gt;2) If the term in the "Term" column is multiplied by any other term (like Place*Thing in the above table), then&amp;nbsp;&lt;SPAN&gt;multiply the value in the "Multiply" column by 2.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;3) If the term in the "Term" column is multiplied by itself(like Name*Name and Animal*Animal in the above table), then keep the value in "Multiply" column as it is.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The resulting table would look like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 451px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9848iC30355EFDEA1AACD/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Can this be done using jsl? Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 21:20:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Comparing-row-values/m-p/53157#M30093</guid>
      <dc:creator>powerpuff</dc:creator>
      <dc:date>2018-03-14T21:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing row values</title>
      <link>https://community.jmp.com/t5/Discussions/Comparing-row-values/m-p/53160#M30094</link>
      <description>deleted my response because I realized I didn’t answer the right question</description>
      <pubDate>Thu, 15 Mar 2018 06:41:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Comparing-row-values/m-p/53160#M30094</guid>
      <dc:creator>cwillden</dc:creator>
      <dc:date>2018-03-15T06:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing row values</title>
      <link>https://community.jmp.com/t5/Discussions/Comparing-row-values/m-p/53169#M30100</link>
      <description>&lt;P&gt;Maybe&amp;nbsp;something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;New Table( "Multiply",
	Add Rows( 8 ),
	New Column( "Term", Character, "Nominal",
		Set Values( {"Name", "Place", "Animal", "Thing", "Name*Name", "Place*Thing",
			"Animal", "Animal*Animal"} )
	),
	New Column( "Multiply", Numeric, "Continuous",
		Format( "Best", 12 ),
		Set Values( [0.43, 0.5567, 0.056, 0.236, 0.15503, 0.44479, 0.7789, 0.22754] )
	),
	New Column( "Result",
		Expression,
		"None",
		Formula(
			mtch = Regex Match( :Term, "([^*]*)\*([^*]*)" );
			If(
				N Items( mtch ) == 0, :Multiply * 2,
				N Items( mtch ) == 3,
					If( mtch[2] == mtch[3],
						:Multiply,
						:Multiply * 2
					)
			);
		)
	)
)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Mar 2018 02:13:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Comparing-row-values/m-p/53169#M30100</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2018-03-15T02:13:12Z</dc:date>
    </item>
  </channel>
</rss>

