<?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 Help with error message - Argument is wrong type in access or evaluation of 'Contains' in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Help-with-error-message-Argument-is-wrong-type-in-access-or/m-p/83824#M37685</link>
    <description>&lt;P&gt;I need to check if the columns contain either of the 2 strings and then replace column value with value in another column.&lt;/P&gt;
&lt;P&gt;Here's the code -&lt;/P&gt;
&lt;PRE class="language-jsl"&gt;&lt;CODE&gt;For(i=1,i&amp;lt;= NRows(dt),i++,
if(contains(:step[i],"NA")| contains(:step[i],".") ,
:step[i] = description[i];
)

);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I get an error saying -&amp;nbsp;argument is wrong type in access or evaluation of 'Contains'&lt;/P&gt;
&lt;P&gt;What am I doing wrong here?&lt;/P&gt;</description>
    <pubDate>Thu, 30 Jan 2020 19:28:17 GMT</pubDate>
    <dc:creator>ENTHU</dc:creator>
    <dc:date>2020-01-30T19:28:17Z</dc:date>
    <item>
      <title>Help with error message - Argument is wrong type in access or evaluation of 'Contains'</title>
      <link>https://community.jmp.com/t5/Discussions/Help-with-error-message-Argument-is-wrong-type-in-access-or/m-p/83824#M37685</link>
      <description>&lt;P&gt;I need to check if the columns contain either of the 2 strings and then replace column value with value in another column.&lt;/P&gt;
&lt;P&gt;Here's the code -&lt;/P&gt;
&lt;PRE class="language-jsl"&gt;&lt;CODE&gt;For(i=1,i&amp;lt;= NRows(dt),i++,
if(contains(:step[i],"NA")| contains(:step[i],".") ,
:step[i] = description[i];
)

);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I get an error saying -&amp;nbsp;argument is wrong type in access or evaluation of 'Contains'&lt;/P&gt;
&lt;P&gt;What am I doing wrong here?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 19:28:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-with-error-message-Argument-is-wrong-type-in-access-or/m-p/83824#M37685</guid>
      <dc:creator>ENTHU</dc:creator>
      <dc:date>2020-01-30T19:28:17Z</dc:date>
    </item>
    <item>
      <title>Help with error message - Argument is wrong type in access or evaluation of 'Contains'</title>
      <link>https://community.jmp.com/t5/Discussions/Help-with-error-message-Argument-is-wrong-type-in-access-or/m-p/83826#M37687</link>
      <description>&lt;P&gt;I beleive the issue is that your column called "description" is not properly being scoped.&amp;nbsp; It needs to have a ":" in front of its reference ":description".&lt;/P&gt;
&lt;P&gt;Here is an example using a sample data table, that does what you want&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open("$SAMPLE_DATA/Big Class.jmp");
For( i = 1, i &amp;lt;= N Rows( dt ), i++,
	If( Contains( :Name[i], "TIM" ) | Contains( :Name[i], "ROBERT" ),
		:Name[i] = :Sex[i]
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Jan 2020 19:28:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-with-error-message-Argument-is-wrong-type-in-access-or/m-p/83826#M37687</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-01-30T19:28:39Z</dc:date>
    </item>
  </channel>
</rss>

