Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
Françoise
Level IV

rename cell

hi,

 

I've wrote this jsl to rename cell with"portion" by "Portion".

It's doesn't work.

has someone a solution?

 

Names Default To Here( 1 );

dt= Current Data Table();

For( I = 1, I <= N Rows( dt ), I++,

if(dt:Format == "portion",

dt:Format == "Portion"

 

);

);

 

 

best regards

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
txnelson
Super User

Re: rename cell

Your script needs to be updated to point directly to the row you want to evaluate and to change

Names Default To Here( 1 );
dt = Current Data Table();
For( I = 1, I <= N Rows( dt ), I++,
	If( dt:Format[I] == "portion",
		dt:Format[I] = "Portion"
	)
);

A more efficient way of coding this is:

Names Default To Here( 1 );
dt = Current Data Table();
dt:Format[dt << get rows where( :Format == "portion" )] = "Portion";

 

Jim

View solution in original post

Highlighted
Françoise
Level IV

Re: rename cell

Hi,

 

Ok, it's good !

 

thanks

View solution in original post

2 REPLIES 2
Highlighted
txnelson
Super User

Re: rename cell

Your script needs to be updated to point directly to the row you want to evaluate and to change

Names Default To Here( 1 );
dt = Current Data Table();
For( I = 1, I <= N Rows( dt ), I++,
	If( dt:Format[I] == "portion",
		dt:Format[I] = "Portion"
	)
);

A more efficient way of coding this is:

Names Default To Here( 1 );
dt = Current Data Table();
dt:Format[dt << get rows where( :Format == "portion" )] = "Portion";

 

Jim

View solution in original post

Highlighted
Françoise
Level IV

Re: rename cell

Hi,

 

Ok, it's good !

 

thanks

View solution in original post

Article Labels

    There are no labels assigned to this post.