<?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 Formula to make a new column in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Formula-to-make-a-new-column/m-p/58555#M32385</link>
    <description>&lt;P&gt;I have a table with four columns, and I am trying to make a new column based off of the available columns. Here is my script:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dtq = current data table();
a = dtq &amp;lt;&amp;lt; New Column( "E",
	Formula(
		If(
			Is Missing( :A ) &amp;amp; Is Missing( :B ), Abs( :C ),
			Is Missing( :A ), Abs( :C / (:B - :D) ) ,
			Is Missing( :B ), Abs( :C / (:D - :A) ),
			//If !Is Missing( :A ) &amp;amp; !IsMissing( :B ), 
			//then do Abs( :C / (:B - :D) ) and Abs( :C / (:D - :A) ) and choose the gretaer value out of the two. 
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The first three conditions work, however the condition with values present in both A and B is something I am unable to work out. How can I make my script calculate 2 formulas and add the greater value out of these to my column in the table? Thank you for any help.&lt;/P&gt;</description>
    <pubDate>Tue, 29 May 2018 17:29:15 GMT</pubDate>
    <dc:creator>Aam_jmp</dc:creator>
    <dc:date>2018-05-29T17:29:15Z</dc:date>
    <item>
      <title>Formula to make a new column</title>
      <link>https://community.jmp.com/t5/Discussions/Formula-to-make-a-new-column/m-p/58555#M32385</link>
      <description>&lt;P&gt;I have a table with four columns, and I am trying to make a new column based off of the available columns. Here is my script:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dtq = current data table();
a = dtq &amp;lt;&amp;lt; New Column( "E",
	Formula(
		If(
			Is Missing( :A ) &amp;amp; Is Missing( :B ), Abs( :C ),
			Is Missing( :A ), Abs( :C / (:B - :D) ) ,
			Is Missing( :B ), Abs( :C / (:D - :A) ),
			//If !Is Missing( :A ) &amp;amp; !IsMissing( :B ), 
			//then do Abs( :C / (:B - :D) ) and Abs( :C / (:D - :A) ) and choose the gretaer value out of the two. 
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The first three conditions work, however the condition with values present in both A and B is something I am unable to work out. How can I make my script calculate 2 formulas and add the greater value out of these to my column in the table? Thank you for any help.&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 17:29:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Formula-to-make-a-new-column/m-p/58555#M32385</guid>
      <dc:creator>Aam_jmp</dc:creator>
      <dc:date>2018-05-29T17:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: Formula to make a new column</title>
      <link>https://community.jmp.com/t5/Discussions/Formula-to-make-a-new-column/m-p/58557#M32386</link>
      <description>&lt;P&gt;You want the &lt;A href="https://www.jmp.com/support/help/14/statistical-functions-2.shtml#2754438" target="_blank"&gt;Max() &lt;/A&gt;function.&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="JMPScreenSnapz211.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/10877iF6733E8C4404B89C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JMPScreenSnapz211.png" alt="JMPScreenSnapz211.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dtq = Current Data Table();
a = dtq &amp;lt;&amp;lt; New Column( "E",
	Formula(
		If(
			Is Missing( :A ) &amp;amp; Is Missing( :B ), Abs( :C ),
			Is Missing( :A ), Abs( :C / (:B - :D) ),
			Is Missing( :B ), Abs( :C / (:D - :A) ),
			!Is Missing( :A ) &amp;amp; !Is Missing( :B ),
				Max( Abs( :C / (:B - :D) ), Abs( :C / (:D - :A) ) )
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 May 2018 17:52:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Formula-to-make-a-new-column/m-p/58557#M32386</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2018-05-29T17:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: Formula to make a new column</title>
      <link>https://community.jmp.com/t5/Discussions/Formula-to-make-a-new-column/m-p/58558#M32387</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dtq = current data table();
a = dtq &amp;lt;&amp;lt; New Column( "E",
	Formula(
		If(
			Is Missing( :A ) &amp;amp; Is Missing( :B ), Abs( :C ),
			Is Missing( :A ), Abs( :C / (:B - :D) ) ,
			Is Missing( :B ), Abs( :C / (:D - :A) ),
			Max(Abs( :C / (:B - :D) ) ,Abs( :C / (:D - :A) ) )
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 May 2018 18:11:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Formula-to-make-a-new-column/m-p/58558#M32387</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-05-29T18:11:59Z</dc:date>
    </item>
  </channel>
</rss>

