cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Discovery is online this week, April 16 and 18. Join us for these exciting interactive sessions.
Choose Language Hide Translation Bar
Françoise
Level V

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
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

Françoise
Level V

Re: rename cell

Hi,

 

Ok, it's good !

 

thanks

View solution in original post

2 REPLIES 2
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
Françoise
Level V

Re: rename cell

Hi,

 

Ok, it's good !

 

thanks