cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
ENTHU
Level IV

Help with error message - Argument is wrong type in access or evaluation of 'Contains'

I need to check if the columns contain either of the 2 strings and then replace column value with value in another column.

Here's the code -

For(i=1,i<= NRows(dt),i++,
if(contains(:step[i],"NA")| contains(:step[i],".") ,
:step[i] = description[i];
)

);

 

But I get an error saying - argument is wrong type in access or evaluation of 'Contains'

What am I doing wrong here?

1 REPLY 1
txnelson
Super User

Help with error message - Argument is wrong type in access or evaluation of 'Contains'

I beleive the issue is that your column called "description" is not properly being scoped.  It needs to have a ":" in front of its reference ":description".

Here is an example using a sample data table, that does what you want

Names Default To Here( 1 );
dt = Open("$SAMPLE_DATA/Big Class.jmp");
For( i = 1, i <= N Rows( dt ), i++,
	If( Contains( :Name[i], "TIM" ) | Contains( :Name[i], "ROBERT" ),
		:Name[i] = :Sex[i]
	)
);
Jim

Recommended Articles