<?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: What's wrong with below code in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/What-s-wrong-with-below-code/m-p/240593#M47540</link>
    <description>Thanks Jim, Got it :)&lt;/img&gt;</description>
    <pubDate>Thu, 09 Jan 2020 00:42:23 GMT</pubDate>
    <dc:creator>jerryspilTC</dc:creator>
    <dc:date>2020-01-09T00:42:23Z</dc:date>
    <item>
      <title>What's wrong with below code</title>
      <link>https://community.jmp.com/t5/Discussions/What-s-wrong-with-below-code/m-p/240467#M47519</link>
      <description>&lt;P&gt;I've got errors on below code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; New Column( "Stage",
	If( Formula( Substr( :Column 9, 1, 2 ) ) == "CP",
		Formula( Left( :Column 9, 3 ) ),
		" "
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to add a new Col named "Stage" besides a raw Column 9, if starts with CP get the 1st 3 letters else blank, but I've got errors&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unexpected end of input. Perhaps there is a missing "," or ")".&lt;BR /&gt;Trying to parse arguments of function "New Column".&lt;BR /&gt;Line 207 Column 3: ►&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect I use Formula in wrong way, might need help here :)&lt;/img&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;Column 9&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;Stage&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;NG&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;CP2-NAVI12&lt;/TD&gt;
&lt;TD&gt;CP2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;CP1-NAVI12&lt;/TD&gt;
&lt;TD&gt;CP1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;NG&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;CP2-NAVI12&lt;/TD&gt;
&lt;TD&gt;CP2&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Wed, 08 Jan 2020 12:37:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/What-s-wrong-with-below-code/m-p/240467#M47519</guid>
      <dc:creator>jerryspilTC</dc:creator>
      <dc:date>2020-01-08T12:37:14Z</dc:date>
    </item>
    <item>
      <title>Re: What's wrong with below code</title>
      <link>https://community.jmp.com/t5/Discussions/What-s-wrong-with-below-code/m-p/240495#M47521</link>
      <description>&lt;P&gt;The issue with your code is that you are not understanding the Formula element from the New Column function.&amp;nbsp; You seem to be approaching the problem thinking that each segment within your line of script that has a function, such as Substr() or Left() needs to be told that it is a formula.&amp;nbsp; Actually, the entire line of jsl:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If( Substr( :Column 9, 1, 2 ) == "CP", Left( :Column 9, 3 ), "" )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;is what needs to be declared as the formula for the new column.&amp;nbsp; Thus the New Column() function needs to be specified as:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; New Column( "Stage",
		Character,
		"Nominal",
		Formula( If( Substr( :Column 9, 1, 2 ) == "CP", Left( :Column 9, 3 ), "" ) )
	);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Jan 2020 11:01:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/What-s-wrong-with-below-code/m-p/240495#M47521</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-01-08T11:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: What's wrong with below code</title>
      <link>https://community.jmp.com/t5/Discussions/What-s-wrong-with-below-code/m-p/240593#M47540</link>
      <description>Thanks Jim, Got it :)&lt;/img&gt;</description>
      <pubDate>Thu, 09 Jan 2020 00:42:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/What-s-wrong-with-below-code/m-p/240593#M47540</guid>
      <dc:creator>jerryspilTC</dc:creator>
      <dc:date>2020-01-09T00:42:23Z</dc:date>
    </item>
  </channel>
</rss>

