cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Have your say in shaping JMP's future by participating in the new JMP Wish List Prioritization Survey
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 )
);