cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Use World Cup data to build models, explore spatial relationships, and create informative visualizations in JMP. Register. July 17, 2 pm US Eastern Time.
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.

Discussions

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

Sort by

Hello

I have a table with 2 columns, "% of Total" and "Correlation"

I would like to sort simultaneously both columns in Descending only 

but when I run the script, the column Correlation is sorted like Descending but % of Total is sorted like Ascending

 

What is wrong with my script? 

dt << sort ( by ( "Correlation" , "% of Total" ), Order ( Descending ), Replace table );

Dennisbur_0-1690379151999.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Sort by

As you want to sort both in same direction, perform the action interactively and get the script from enhanced log

jthi_0-1690381082229.png

 

// Open Data Table: Big Class.jmp
// → Data Table("Big Class")
Open("$SAMPLE_DATA/Big Class.jmp");


// Sort data table
Data Table("Big Class") << Sort(
	By(:height, :weight),
	Replace Table,
	Order(Descending, Descending)
);

Most likely it is using default sorting for the second column which seems to be ascending

 

-Jarmo

View solution in original post

1 REPLY 1
jthi
Super User

Re: Sort by

As you want to sort both in same direction, perform the action interactively and get the script from enhanced log

jthi_0-1690381082229.png

 

// Open Data Table: Big Class.jmp
// → Data Table("Big Class")
Open("$SAMPLE_DATA/Big Class.jmp");


// Sort data table
Data Table("Big Class") << Sort(
	By(:height, :weight),
	Replace Table,
	Order(Descending, Descending)
);

Most likely it is using default sorting for the second column which seems to be ascending

 

-Jarmo

Recommended Articles