cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

Discussions

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

How to format a list of columns?

I just can't seem to figure out the syntax. I'm trying to set this group of columns to a fixed decimal. I can't figure out how to assign the columns to a variable

 

 

colList = column( dt, "MEAN", "STDEV", "MIN", "Q1", "MEDIAN", "Q3", "MAX")
For(i=1,i<=n items(colList), i++,
column(dt, colList[i]) << data type("numeric")<< Format( "Fixed Dec", 12, 3 );
);

 

1 REPLY 1

Re: How to format a list of columns?

You're close, you just need the column names to be in a list (see code below.)

 

Be sure to check out "Standardize Attributes" in the columns menu (or from a right-click on a column header). It will allow you to alter settings for all selected columns en-masse via point-and-click, which may obviate the need to script this, depending on your use case.

 

Cheers,

Brady

 

dt = Current Data Table();

colList = {"MEAN", "STDEV", "MIN", "Q1", "MEDIAN", "Q3", "MAX"};

For( i = 1, i <= N Items( colList ), i++,
	Column( dt, colList[i] ) << data type( "numeric" ) << Format( "Fixed Dec", 12, 3 )
);

Recommended Articles