cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

Discussions

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

How do combine numbers in a column with other literals to form text characters?

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
ar = dt << GetAsMatrix( {4} );

txt1 = "abc=" || Char( ar );

I use the above code does not match, much []

2022-08-07_22-14-57.png

 

What I need is the following result:

Thanks!

 

 


txt1 = "abc=59, 61, 55, 66, 52, 60, 61, 51, 60, 61, 56, 65, 63, 58, 59, 61, 62, 65, 63, 62, 63, 64, 65, 64, 68, 64, 69, 62, 64, 67, 65, 66, 62, 66, 65, 60, 68, 62, 68, 70"

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
vince_faller
Super User (Alumni)

Re: How do combine numbers in a column with other literals to form text characters?

If you know it's just going to be a matrix, you could just lop off the []. 

 

txt1 = "abc=" || Substitute(Char( ar ), "[", "", "]", "");
Vince Faller - Predictum

View solution in original post

3 REPLIES 3
txnelson
Super User

Re: How do combine numbers in a column with other literals to form text characters?

Apparently the JSL parser is forcing the numerics into a matrix.  I suggest you turn the issue into JMP support for their feedback.  In the mean time, here is a workaround:

names default to here(1);
// Open Data Table: big class.jmp
// → Data Table( "big class" )
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
ar = dt << GetAsMatrix( 4 );

txt1 = "abc=" || char(ar[1]);
for(i=2,i<=nitems(ar), i++,
	txt1 = txt1 || ", " || char(ar[i])
);
show(txt1);
Jim
lala
Level IX

Re: How do combine numbers in a column with other literals to form text characters?

Thank Jim!

2022-08-08_07-23-40.png

vince_faller
Super User (Alumni)

Re: How do combine numbers in a column with other literals to form text characters?

If you know it's just going to be a matrix, you could just lop off the []. 

 

txt1 = "abc=" || Substitute(Char( ar ), "[", "", "]", "");
Vince Faller - Predictum

Recommended Articles