cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • See how to interactively organize and restructure data for analysis. Register for May 29 webinar, 2pm US ET.

Discussions

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

Summary and Sorting - Sorting not working

I have a data table where I am wanting to calculate mean, and have the output sorted (Descending) from a grouped column.  

 

As an example

I.e., Data table

justvince_0-1641851082378.png

 

If I summarize as follows:

Data Table( "Example_DT" ) << Summary(
Group( :i, :f, :g, :h ),
Order( Descending, Descending, Descending, Descending ),
Mean( :Values ),
Freq( "None" ),
Weight( "None" )
);

i.e., Selecting Descending

justvince_3-1641852202649.png

 

 

 

Output is incorrect:  Shouldn't Column "i" start with 4 and descend down to 1?  (This is the problem I am having with my large data table)

justvince_1-1641851257020.png

 

If I try to sort by saying I want column i in ascending order it produces the same table

 

Data Table( "Example_DT" ) << Summary(
Group( :i, :f, :g, :h ),
Order( Ascending, Ascending, Ascending, Ascending ),
Mean( :Values ),
Freq( "None" ),
Weight( "None" )
);

justvince_2-1641851482920.png

 

I am using JMP 16.2.0

 

4 REPLIES 4
txnelson
Super User

Re: Summary and Sorting - Sorting not working

You have intermixed the control statements for Summary and Sorting platforms.  They need to be separate steps.  Here is the way I handle what you want

Names Default To Here( 1 );
dt = Current Data Table();

Data Table( "Example_DT" ) << Summary(
	Group( :i, :f, :g, :h ), 
	Mean( :Values ),
	Freq( "None" ),
	Weight( "None" )
);

Data Table( "Example_DT By (i, f, g, h)" ) << sort(
	Replace Table( 1 ),
	By( :i, :f, :g, :h ),
	Order( Descending, Descending, Descending, Descending )
);
Jim
justvince
Level III

Re: Summary and Sorting - Sorting not working

Well... it was not I who intermixed the control statements.   

The user interface for creating a summary table has the options built in for the groups to be able to sort (Ascending/Descending). 

The summarized data table "source" script has the script that I copied above including the Order.   

I believe this may have worked in past JMP versions, because I am just now finding out this is not working... (I could be wrong, but don't think so).  

 

justvince_0-1641857645874.png

 

 

txnelson
Super User

Re: Summary and Sorting - Sorting not working

I was not aware of the options, but as you found, they do not appear to work.  I would submit the issue to 

     support@jmp.com

Jim
justvince
Level III

Re: Summary and Sorting - Sorting not working

Thanks! JMP is now aware of the bug.  

 

Recommended Articles