cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
StarfruitBob
Level VI

Coding property didn’t have two numbers

Hello,

 

I have the for loop below iterating through columns assigning a "coding" property to each one. all_cols is the list of columns of interest. The function works - almost as intended.  The coding property is assigned correctly, col min & col max values included.

for( y = 1, y <= N Items( all_cols ), y++,
	row() = y;
	lims = Eval List( { col min( eval( all_cols[y] ) ), col max( eval( all_cols[y] ) ) } );
	all_cols[y] << Set Property( "Coding", Expr( lims ) );
);

However, in the enhanced log, I notice the error "Coding property didn’t have two numbers" iterate once for each column in all_cols. I've counted.

 

Here's where this presents a problem.  Later in my script, Standard Least Squares is performed.  Once I go to remove an effect from the list of effects in Effect Summary, an error box of the same message appears. Shown below.  If the box is exited using the "x" in the upper right corner, or if the "OK" button is pressed, this box will indefinitely appear, locking up usage of JMP until I end JMP's tasks forcefully. 

StarfruitBob_0-1678902601434.png

 

A for each() function will have the same error, given similar JMP expression evaluations. This would be equivalent to highlighting all of the columns and batch changing all of their properties through Standardize Attributes.


Any thoughts on what's happening and how to stop it?

Learning every day!
2 ACCEPTED SOLUTIONS

Accepted Solutions

Re: Coding property didn’t have two numbers

Do this after running your script to add the Coding property: click the red triangle in the Table panel in the upper left corner of the data table, and select Copy Table Script. Then open a new script editor and paste the script. Examine the Set Property arguments. You should see a list with two numbers for the second argument. If you don't, then your script is wrong.

View solution in original post

StarfruitBob
Level VI

Re: Coding property didn’t have two numbers

This was a simple fix. Verified working with my datasets!

 

for( y = 1, y <= N Items( all_cols ), y++,
	row() = y;
	lims = Eval List( { col min( eval( all_cols[y] ) ), col max( eval( all_cols[y] ) ) } );
	Eval( Eval expr ( all_cols[y] << Set Property( "Coding", Expr( lims )  ) ) );
);
Learning every day!

View solution in original post

6 REPLIES 6

Re: Coding property didn’t have two numbers

The Coding column property looks correct in the Column Info dialog but is incorrect. I examined the data table script and discovered that the second argument to the << Set Property() message is assigned literally. It does not use the value stored in lims. You have to substitute the value yourself. Here is one way that works.

 

For( i = 1, i < N Col(), i++,
	lims = Eval List( {Col Min( Eval( Column(i) ) ), Col Max( Eval( Column(i) ) )} );
	Eval(
		Substitute(
			Expr( Column( i ) << Set Property( "Coding", ccc ); ),
			Expr( ccc ), lims
		)
	)
);

This property is automatically added when you click Make Table in a JMP DOE platform. Why do you need to add this property after the table is created?

 

StarfruitBob
Level VI

Re: Coding property didn’t have two numbers

all_cols is a list of columns, but it's being iterated through by the loop. The line under where lims is defined calls on lims with Expr().  Does this help?

Learning every day!
StarfruitBob
Level VI

Re: Coding property didn’t have two numbers

Here are more notes on this issue:

  • Using << Get Property("Coding") for each of the columns in the loop, the pairs of col min and col max values are returned successfully. This verifies that the property was correctly assigned, and values populated.
  • When isolating the code for Set Property() to a blank script, it runs fine, no error notifications in the enhanced logs... However, read below.
  • When in the Fit Model dialog, after performing the Set Property() from a separate script, as mentioned above, the error still occurs.
    StarfruitBob_0-1678906789864.png

     

     
Learning every day!

Re: Coding property didn’t have two numbers

Do this after running your script to add the Coding property: click the red triangle in the Table panel in the upper left corner of the data table, and select Copy Table Script. Then open a new script editor and paste the script. Examine the Set Property arguments. You should see a list with two numbers for the second argument. If you don't, then your script is wrong.

StarfruitBob
Level VI

Re: Coding property didn’t have two numbers

StarfruitBob_0-1678908541407.png

Excellent catch!  This is what's in the table script. I'll fiddle around with my coding to get the values necessary in there.  Thank you, @Mark_Bailey !

I'll keep this thread open until I post the resolution.

 

Learning every day!
StarfruitBob
Level VI

Re: Coding property didn’t have two numbers

This was a simple fix. Verified working with my datasets!

 

for( y = 1, y <= N Items( all_cols ), y++,
	row() = y;
	lims = Eval List( { col min( eval( all_cols[y] ) ), col max( eval( all_cols[y] ) ) } );
	Eval( Eval expr ( all_cols[y] << Set Property( "Coding", Expr( lims )  ) ) );
);
Learning every day!