<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Using JSL script to sort a column in a data table using List Check or Value Order property in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Using-JSL-script-to-sort-a-column-in-a-data-table-using-List/m-p/373480#M62311</link>
    <description>&lt;P&gt;In JMP 15 the structure of the column property Value Order changed.&amp;nbsp; Here is an example of the new structure&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt=open("$SAMPLE_DATA\big class.jmp");

dt:sex&amp;lt;&amp;lt;set property("value order",{Custom Order({"M", "F"})});

dt &amp;lt;&amp;lt; sort( by(:sex), replace table(1));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I suggest that you manually set the Value Order you want, and then use &amp;lt;&amp;lt; get property("value order") to see how you need to structure your statement for your data&lt;/P&gt;</description>
    <pubDate>Thu, 01 Apr 2021 11:30:50 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2021-04-01T11:30:50Z</dc:date>
    <item>
      <title>Using JSL script to sort a column in a data table using List Check or Value Order property</title>
      <link>https://community.jmp.com/t5/Discussions/Using-JSL-script-to-sort-a-column-in-a-data-table-using-List/m-p/373467#M62310</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;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:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt_summary_table = (Data Table( "Name of table" )) &amp;lt;&amp;lt; Make Into Data Table; // This works fine and created a datatable.&amp;nbsp;

//Using List Check property
dt_summary_table &amp;lt;&amp;lt; Column( "Column_name_eg_Names" ) &amp;lt;&amp;lt; Set Property(
    "List Check",
    {"OrderList_A", "OrderList_B", "OrderList_C"}
);

// Or using Value Order property&amp;nbsp;
dt_summary_table &amp;lt;&amp;lt; Column( "Column_name_eg_Names" ) &amp;lt;&amp;lt; Set Property(
    "Value Order",
    {"OrderList_A", "OrderList_B", "OrderList_C"}
);&amp;nbsp;

//or using List Check property
dt_summary_table &amp;lt;&amp;lt; Column( "Column_name_eg_Names" ) &amp;lt;&amp;lt; List Check( {"OrderList_A", "OrderList_B", "OrderList_C"} );

// Or using Value Order property&amp;nbsp;
dt_summary_table &amp;lt;&amp;lt; Column( "Column_name_eg_Names" ) &amp;lt;&amp;lt; Value Order( {"OrderList_A", "OrderList_B", "OrderList_C"} );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm using JMP15 on Windows10.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:28:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-JSL-script-to-sort-a-column-in-a-data-table-using-List/m-p/373467#M62310</guid>
      <dc:creator>JmpStatistician</dc:creator>
      <dc:date>2023-06-10T23:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using JSL script to sort a column in a data table using List Check or Value Order property</title>
      <link>https://community.jmp.com/t5/Discussions/Using-JSL-script-to-sort-a-column-in-a-data-table-using-List/m-p/373480#M62311</link>
      <description>&lt;P&gt;In JMP 15 the structure of the column property Value Order changed.&amp;nbsp; Here is an example of the new structure&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt=open("$SAMPLE_DATA\big class.jmp");

dt:sex&amp;lt;&amp;lt;set property("value order",{Custom Order({"M", "F"})});

dt &amp;lt;&amp;lt; sort( by(:sex), replace table(1));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I suggest that you manually set the Value Order you want, and then use &amp;lt;&amp;lt; get property("value order") to see how you need to structure your statement for your data&lt;/P&gt;</description>
      <pubDate>Thu, 01 Apr 2021 11:30:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-JSL-script-to-sort-a-column-in-a-data-table-using-List/m-p/373480#M62311</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-04-01T11:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: Using JSL script to sort a column in a data table using List Check or Value Order property</title>
      <link>https://community.jmp.com/t5/Discussions/Using-JSL-script-to-sort-a-column-in-a-data-table-using-List/m-p/373487#M62312</link>
      <description>&lt;P&gt;Thanks Jim/@txnelson very much,&lt;/P&gt;&lt;P&gt;This works now.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just wondering if this new structure is documented somewhere ? I was following the documentation at&amp;nbsp;&lt;A href="https://www.jmp.com/support/help/en/15.0/#page/jmp/column-properties-3.shtml#" target="_blank"&gt;https://www.jmp.com/support/help/en/15.0/#page/jmp/column-properties-3.shtml#&lt;/A&gt;&amp;nbsp;which doens't seem to reflect the custom order syntax.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Apr 2021 11:44:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-JSL-script-to-sort-a-column-in-a-data-table-using-List/m-p/373487#M62312</guid>
      <dc:creator>JmpStatistician</dc:creator>
      <dc:date>2021-04-01T11:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using JSL script to sort a column in a data table using List Check or Value Order property</title>
      <link>https://community.jmp.com/t5/Discussions/Using-JSL-script-to-sort-a-column-in-a-data-table-using-List/m-p/373494#M62314</link>
      <description>&lt;P&gt;I agree with you that the documentation is in error.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Apr 2021 12:00:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-JSL-script-to-sort-a-column-in-a-data-table-using-List/m-p/373494#M62314</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-04-01T12:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using JSL script to sort a column in a data table using List Check or Value Order property</title>
      <link>https://community.jmp.com/t5/Discussions/Using-JSL-script-to-sort-a-column-in-a-data-table-using-List/m-p/844405#M101841</link>
      <description>&lt;P&gt;Hello Jim,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When attempting to Set Property for Custom Order with a given List, the List is not interpolated/evaluated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May I know how we can make it work with a given variable List ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();

order_list = { "Tony", "Robert", "Patrick", "Henry" };

dt:Names &amp;lt;&amp;lt; Set Property(
	"Value Order",
	{ Custom Order( order_list ), Common Order( 0 ) }
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In example above:&lt;/P&gt;&lt;P&gt;Running&amp;nbsp;Custom Order( order_list ) sets the value order with a literal value named "order_list"&lt;/P&gt;&lt;P&gt;Running&amp;nbsp;Custom Order( Eval(order_list) ) sets the value order with a literal value named "Eval"&lt;/P&gt;&lt;P&gt;Running&amp;nbsp;Custom Order( EvalList(order_list) ) sets the value order with a literal value named "Eval List"&lt;/P&gt;&lt;P&gt;Literally listing the values in Custom Order without calling variable, only then it works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2025 05:49:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-JSL-script-to-sort-a-column-in-a-data-table-using-List/m-p/844405#M101841</guid>
      <dc:creator>ylee</dc:creator>
      <dc:date>2025-02-26T05:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using JSL script to sort a column in a data table using List Check or Value Order property</title>
      <link>https://community.jmp.com/t5/Discussions/Using-JSL-script-to-sort-a-column-in-a-data-table-using-List/m-p/844406#M101842</link>
      <description>&lt;P&gt;This should do the trick for you&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();

order_list = {"Tony", "Robert", "Patrick", "Henry"};

Eval(
	Eval Expr(
		dt:Names &amp;lt;&amp;lt; Set Property(
			"Value Order",
			{Custom Order( Expr( order_list ) ), Common Order( 0 )}
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Feb 2025 05:57:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-JSL-script-to-sort-a-column-in-a-data-table-using-List/m-p/844406#M101842</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2025-02-26T05:57:50Z</dc:date>
    </item>
  </channel>
</rss>

