cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Discovery is online this week, April 16 and 18. Join us for these exciting interactive sessions.
Choose Language Hide Translation Bar
vishwasanj
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
dale_lehman
Level VII

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).

View solution in original post

5 REPLIES 5
dale_lehman
Level VII

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. 

vishwasanj
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.

dale_lehman
Level VII

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).

vishwasanj
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 ),
Add Table(
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;
vishwasanj
Level V

Re: Median for all columns

Actually that works. Thank you Dale.