<?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: how to sort x axis by another column value in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/how-to-sort-x-axis-by-another-column-value/m-p/442713#M69097</link>
    <description>&lt;P&gt;Not sure I understand what you need, but the same approach can be used for Variability Chart. If grouped by an additional variable, the value ordering should be correctly applied within each group.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's an example based on the Big Class example table:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open("$SAMPLE_DATA/Big Class.jmp");

// Set value ordering to :name after mean :age
Summarize( g = by( :name ), m = Mean( :age ) );
:Name &amp;lt;&amp;lt; Set Property( "Value Ordering", Eval( g[Rank Index( m )] ) );

// Variability chart with names grouped by sex ordered after age
Variability Chart(Y(:height), X(:sex, :name));
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 06 Dec 2021 15:28:51 GMT</pubDate>
    <dc:creator>ms</dc:creator>
    <dc:date>2021-12-06T15:28:51Z</dc:date>
    <item>
      <title>how to sort x axis by another column value</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-sort-x-axis-by-another-column-value/m-p/86626#M38643</link>
      <description>&lt;P&gt;For example, I have 3 column:&lt;/P&gt;&lt;P&gt;Name Age Score:&lt;/P&gt;&lt;P&gt;Jason&amp;nbsp; 21 98&lt;/P&gt;&lt;P&gt;Alice 19 67&lt;/P&gt;&lt;P&gt;Dave 36 89&lt;/P&gt;&lt;P&gt;John 28 70&lt;/P&gt;&lt;P&gt;I would like to plot x:&amp;nbsp; Name and Y: Score, but I also want to sort X axis (names) by their Age.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much for the help!&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2019 01:40:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-sort-x-axis-by-another-column-value/m-p/86626#M38643</guid>
      <dc:creator>jasongao</dc:creator>
      <dc:date>2019-01-03T01:40:33Z</dc:date>
    </item>
    <item>
      <title>Re: how to sort x axis by another column value</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-sort-x-axis-by-another-column-value/m-p/86629#M38645</link>
      <description>&lt;P&gt;When using Graph Builder, all that has to be done, is to drag the variable you want to order your axis by, to the Order By area for the Axis, as shown below&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="order.PNG" style="width: 950px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/14965i3494468E2FE44894/image-size/large?v=v2&amp;amp;px=999" role="button" title="order.PNG" alt="order.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Or you can sort the data table by the sort variable(Age), and then set the Column Property, Row Order Levels for the column Name, and then the order used for the Name variable axis will be the order the Names are found in the data table.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2019 02:00:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-sort-x-axis-by-another-column-value/m-p/86629#M38645</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-01-03T02:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: how to sort x axis by another column value</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-sort-x-axis-by-another-column-value/m-p/86630#M38646</link>
      <description>&lt;P&gt;I think the column property "Value Ordering" is what you need. It can be set&amp;nbsp;manually using the column dialog or with jsl (example below).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Example Table
New Table("test",
    Add Rows(4),
    New Column("Name",
    Character,
        Set Values({"Jason", "Alice", "Dave", "John"})
    ),
    New Column("Age",
        Set Values([21, 19, 36, 28])
    ),
    New Column("Score:",
        Set Values([98, 67, 89, 70])
    )
);
// Plot Score by Age
Oneway(Y(:Name("Score:")), X(:Name));

// Set value ordering to Name after mean Age
Summarize( g = by( :Name ), m = Mean( :Age ) );
:Name &amp;lt;&amp;lt; Set Property( "Value Ordering", Eval( g[Rank Index( m )] ) );

// Plot again!
Oneway(Y(:Name("Score:")), X(:Name));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Jan 2019 02:04:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-sort-x-axis-by-another-column-value/m-p/86630#M38646</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2019-01-03T02:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: how to sort x axis by another column value</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-sort-x-axis-by-another-column-value/m-p/86639#M38647</link>
      <description>&lt;P&gt;Thanks! It works!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2019 03:44:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-sort-x-axis-by-another-column-value/m-p/86639#M38647</guid>
      <dc:creator>jasongao</dc:creator>
      <dc:date>2019-01-03T03:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: how to sort x axis by another column value</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-sort-x-axis-by-another-column-value/m-p/442639#M69092</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea how I can use ms suggestion by group?&lt;BR /&gt;for the above example, let's say I like to chart the oneway by gander.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can do this with graph builder but I like to use the Variability Chart.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Oneway(Y(:Name("Score:")), X(:Name), By(:Name("Gander"));&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//With Graph Builder

Graph Builder(
Size( 800, 500),
Variables(
X( :name, Order By( :age, Ascending, Order Statistic( "Mean" ) ),

....

Group X( :Gender, N View Levels( 2 ), First View Level( 2 ) ),

...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 12:39:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-sort-x-axis-by-another-column-value/m-p/442639#M69092</guid>
      <dc:creator>AdamChoen</dc:creator>
      <dc:date>2021-12-06T12:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to sort x axis by another column value</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-sort-x-axis-by-another-column-value/m-p/442713#M69097</link>
      <description>&lt;P&gt;Not sure I understand what you need, but the same approach can be used for Variability Chart. If grouped by an additional variable, the value ordering should be correctly applied within each group.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's an example based on the Big Class example table:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open("$SAMPLE_DATA/Big Class.jmp");

// Set value ordering to :name after mean :age
Summarize( g = by( :name ), m = Mean( :age ) );
:Name &amp;lt;&amp;lt; Set Property( "Value Ordering", Eval( g[Rank Index( m )] ) );

// Variability chart with names grouped by sex ordered after age
Variability Chart(Y(:height), X(:sex, :name));
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Dec 2021 15:28:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-sort-x-axis-by-another-column-value/m-p/442713#M69097</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2021-12-06T15:28:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to sort x axis by another column value</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-sort-x-axis-by-another-column-value/m-p/442832#M69106</link>
      <description>&lt;P&gt;Sorry, the Sex group example is not so good since it has few (or no) similar names on each group.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is the same example based on the semiconductor table:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");

// Set value ordering to :name after mean :age
Summarize( g = by( :lot_id ), m = Mean( :PNP1 ) );
:lot_id &amp;lt;&amp;lt; Set Property( "Value Ordering", Eval( g[Rank Index( m )] ) );

// Variability chart with names grouped by sex ordered after age
Variability Chart(Y(:NPN1), X(:SITE, :lot_id));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;it results with the below Var chart (all SITE has same lot_id order) - which is wrong I believe.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;How can I plot the lot_id order by PNP1 for every SITE in Var chart using jsl.&lt;BR /&gt;Hope I made my request clearer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I prefer using&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Variability Chart(Y(:NPN1), X(:SITE), By (:lot_id));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and not&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Variability Chart(Y(:NPN1), X(:SITE, :lot_id));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Also, the statement that I can do this using graph builder from my previous replay here is wrong, I see that now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Image 173.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/38190iC23B291116D6360A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Image 173.png" alt="Image 173.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AdamChoen_0-1638823052051.png" style="width: 998px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/38191iE58392F94E05E68C/image-dimensions/998x317?v=v2" width="998" height="317" role="button" title="AdamChoen_0-1638823052051.png" alt="AdamChoen_0-1638823052051.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 20:47:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-sort-x-axis-by-another-column-value/m-p/442832#M69106</guid>
      <dc:creator>AdamChoen</dc:creator>
      <dc:date>2021-12-06T20:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: how to sort x axis by another column value</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-sort-x-axis-by-another-column-value/m-p/442876#M69110</link>
      <description>&lt;P&gt;I think creating a concat column will do the trick as follow&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");

dt &amp;lt;&amp;lt; New Column("lotID by Site", Character, Formula(char(:SITE)||"_"||:lot_id) );

// Set value ordering to :name after mean :age
Summarize( g = by( :Name("lotID by Site") ), m = Mean( :PNP1 ) );
:Name("lotID by Site")  &amp;lt;&amp;lt; Set Property( "Value Ordering", Eval( g[Rank Index( m )] ) );

// Variability chart with names grouped by sex ordered after age
Variability Chart(Y(:NPN1), X(:Name("lotID by Site")), by (:SITE));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;if anyone can share a more elegant solution I will appreciate it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 23:47:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-sort-x-axis-by-another-column-value/m-p/442876#M69110</guid>
      <dc:creator>AdamChoen</dc:creator>
      <dc:date>2021-12-06T23:47:34Z</dc:date>
    </item>
  </channel>
</rss>

