Subscribe Bookmark RSS Feed

Store Column as list?

matt7109

Contributor

Joined:

Jun 9, 2017

Hi there,

I was wondering if there is any way to store the values of a column in a list, arrray, etc. 

Thanks!

2 REPLIES
txnelson

Super User

Joined:

Jun 22, 2012

Here is the example taken from

     Help==Scripting Index==>Data Table==>Column Scripting==>Get Values

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
valuesMatrix = :Height << Get Values;
Show( valuesMatrix );
valuesList = :Height <<
GetValues(
	Format(/* a numeric column will be list of character items if a format is supplied, see format function */
		"Currency",
		"EUR",
		2,
		<<use locale(
			0 /* ignore locale and use period for decimal.  the default is 1: use the locale. */
		)
	)
);
Show( valuesList );
Jim
markbailey

Staff

Joined:

Jun 23, 2011

JSL makes this operation very easy. It is bi-directional, too!

Please see Help > Books > Scripting Guide for more information. There is a lot of information about working with data columns and tables as matrices and lists because this task is common in scripts. You can see the entire object protocol at once by selecting Help > Scripting Index. Change the drop down menu at the top left to Objects, then select Data Column.

Asking a question here is a great way to solve a problem but your question will be limited by your current knowledge and understanding. If you don't know JMP or JSL, then your question must be based on some other frame of reference that is unlikely to apply. That is, JMP, and therefore JSL, is not like Excel, R, or any other software. Learning from the Scripting Guide will correct that problem.

Learn it once, use it forever!