cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

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

Renaming a column

I am trying to rename a column using the following script but it does not work, can anyone tell me what is wrong with this script? are there better ways to rename columns?

col2 = Column(2);
col2 = Set Name ("XYZ");

Thanks.
1 ACCEPTED SOLUTION

Accepted Solutions
pmroz
Super User

Re: Renaming a column

You're close. Try this instead:


col2 = Column(2);
col2 << Set Name ("XYZ");

View solution in original post

3 REPLIES 3
pmroz
Super User

Re: Renaming a column

You're close. Try this instead:


col2 = Column(2);
col2 << Set Name ("XYZ");
asvp
Level I

Re: Renaming a column

Thanks....that works.
jorgeramosdealm
Level III

Re: Renaming a column

You can also use munger to change part of the name of a column. This is useful after "tabulate" or "summary" specially if you iterate through the different variables.

eg one variable

column(data_table,2)<<set name(munger(munger(eval(char(column(data_table,2))),1,"Column(\!"text_that_you_want_to_change ",""),1,")\!")",""));

eg all variables

for(i=1,i<=n col(data_table),i++,

column(data_table,i)<<set name(munger(munger(eval(char(column(data_table,i))),1,"Column(\!"text_that_you_want_to_change ",""),1,")\!")","")));

Recommended Articles