cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar

Using JSL script to sort a column in a data table using List Check or Value Order property

Hi all,

I'd like to use the List Check feature or the Value Order column property to custom sort a column in a datatable. This data table is created from a subset of another data table, but I am unable to get the property to custom sort the values in the data table. The relevant commands I'm using is as listed below:

 

 

dt_summary_table = (Data Table( "Name of table" )) << Make Into Data Table; // This works fine and created a datatable. 

//Using List Check property
dt_summary_table << Column( "Column_name_eg_Names" ) << Set Property(
    "List Check",
    {"OrderList_A", "OrderList_B", "OrderList_C"}
);

// Or using Value Order property 
dt_summary_table << Column( "Column_name_eg_Names" ) << Set Property(
    "Value Order",
    {"OrderList_A", "OrderList_B", "OrderList_C"}
); 

//or using List Check property
dt_summary_table << Column( "Column_name_eg_Names" ) << List Check( {"OrderList_A", "OrderList_B", "OrderList_C"} );

// Or using Value Order property 
dt_summary_table << Column( "Column_name_eg_Names" ) << Value Order( {"OrderList_A", "OrderList_B", "OrderList_C"} );

 

 

Could someone please advise what might be going bad or best way to sort the column values in custom sort order while displaying graphs/ plots etc. 

I'm using JMP15 on Windows10.

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Using JSL script to sort a column in a data table using List Check or Value Order property

In JMP 15 the structure of the column property Value Order changed.  Here is an example of the new structure

names default to here(1);
dt=open("$SAMPLE_DATA\big class.jmp");

dt:sex<<set property("value order",{Custom Order({"M", "F"})});

dt << sort( by(:sex), replace table(1));

I suggest that you manually set the Value Order you want, and then use << get property("value order") to see how you need to structure your statement for your data

Jim

View solution in original post

3 REPLIES 3
txnelson
Super User

Re: Using JSL script to sort a column in a data table using List Check or Value Order property

In JMP 15 the structure of the column property Value Order changed.  Here is an example of the new structure

names default to here(1);
dt=open("$SAMPLE_DATA\big class.jmp");

dt:sex<<set property("value order",{Custom Order({"M", "F"})});

dt << sort( by(:sex), replace table(1));

I suggest that you manually set the Value Order you want, and then use << get property("value order") to see how you need to structure your statement for your data

Jim

Re: Using JSL script to sort a column in a data table using List Check or Value Order property

Thanks Jim/@txnelson very much,

This works now. 

Just wondering if this new structure is documented somewhere ? I was following the documentation at https://www.jmp.com/support/help/en/15.0/#page/jmp/column-properties-3.shtml# which doens't seem to reflect the custom order syntax. 

txnelson
Super User

Re: Using JSL script to sort a column in a data table using List Check or Value Order property

I agree with you that the documentation is in error.  

Jim