Choose Language Hide Translation Bar
Highlighted
Level V

## Median for all columns

Hi All,

Is there an easier way to calculate median of all the columns, rather than getting the summary in different tables and then joining all the data tables together? I have like 200 columns that I need to calculate the median from.  I appreciate all the comments and suggestions.

``````for(r=1,r<=N Items(List),r++,
Summary(
Group( :Mask, :Lot,:Workweek ),
Median( Column(dt,List[r]) ),
Freq( "None" ),
Weight( "None" )
);

);``````

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Level VI

## Re: Median for all columns

Use the Tabulate platofrm (under the Analyze menu).  You should be able to put your grouping variables in any order you want and just ask for the median for all the continuous columns (put in the body of the table).  Then Make into a Data Table (found at the red arrow in the Tabulate platform).

5 REPLIES 5
Highlighted
Level VI

## Re: Median for all columns

You can use the Table-Summary command.  Choose all the columns (of course, nominal columns will not give you medians) and choose Median from the drop down.  Do not put a grouping variable.  You will get a new data table with all the median values.

Highlighted
Level V

## Re: Median for all columns

Hi Dale,

Thank you for the suggestion. I need to put the grouping variable by workweek, lot and mask. Is there a way to open a new data table and populate it median values sorted by the grouping variable for different columns?

Thanks.

Highlighted
Level VI

## Re: Median for all columns

Use the Tabulate platofrm (under the Analyze menu).  You should be able to put your grouping variables in any order you want and just ask for the median for all the continuous columns (put in the body of the table).  Then Make into a Data Table (found at the red arrow in the Tabulate platform).

Highlighted
Level V

## Re: Median for all columns

Thats a really nice idea. Thanks Dale. If I have changing column names, I need to see how to represent the list of column names in "Analysis column" if I use a loop function. any thoughts?

``````(dt <<Tabulate(
Show Control Panel( 0 ),
Column Table(
Statistics( Median ),
Analysis Columns(
:Name( "ColA" ),
:Name( "ColB" ),
:Name( "ColC" ),
:Name( "ColD" ),
:Name( "ColE" )
)
),
Row Table( Grouping Columns( :LOTID, :MASK, :WW ) )
)
) )<< Make Into Data Table;``````
Highlighted
Level V

## Re: Median for all columns

Actually that works. Thank you Dale.

Article Labels

There are no labels assigned to this post.