cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
Heinrich
Level II

Use the content of a selected cell and use it as the name for a new column.

Dear all, I try to create a script where I use the cell value or content of a selected cell an use this as the name for a new created column. 

In general I could not find the script command to copy or read the content of a selected cell - maybe it is to obvious that I can't find it... 

Many thanks for any help. 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Byron_JMP
Staff

Re: Use the content of a selected cell and use it as the name for a new column.

here's a little something to help you get started.

//Make an example table
dt=New Table( "Example",
	Add Rows( 5 ),
	New Column( "Column 1",
		Character,
		"Nominal",
		Set Values( {"alpha", "beta", "gamm", "delta", "ice-cream"} )
	)
);

//get the value of the first column in dt, at the 5th row
nnn=column(dt,1)[5];
//make a new useing the value obtained above
dt<<new column(nnn);
JMP Systems Engineer, Health and Life Sciences (Pharma)

View solution in original post

2 REPLIES 2

Re: Use the content of a selected cell and use it as the name for a new column.

See the Scripting Index for specific syntax information. You can query the data table to get the currently selected rows. You can likewise query to get the currently selected columns. You access individual values in the data table using subscripts: dataTable[row,column].

Byron_JMP
Staff

Re: Use the content of a selected cell and use it as the name for a new column.

here's a little something to help you get started.

//Make an example table
dt=New Table( "Example",
	Add Rows( 5 ),
	New Column( "Column 1",
		Character,
		"Nominal",
		Set Values( {"alpha", "beta", "gamm", "delta", "ice-cream"} )
	)
);

//get the value of the first column in dt, at the 5th row
nnn=column(dt,1)[5];
//make a new useing the value obtained above
dt<<new column(nnn);
JMP Systems Engineer, Health and Life Sciences (Pharma)