- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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 )
);