- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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 );
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Sort by
As you want to sort both in same direction, perform the action interactively and get the script from enhanced log
// 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Sort by
As you want to sort both in same direction, perform the action interactively and get the script from enhanced log
// 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