<?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 can I sort the order of my group variable in SGPLOT using HBOX in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-can-I-sort-the-order-of-my-group-variable-in-SGPLOT-using/m-p/637679#M19722</link>
    <description>&lt;P&gt;Thanks a lot that's fantastic!&lt;/P&gt;</description>
    <pubDate>Sun, 05 Apr 2020 13:25:11 GMT</pubDate>
    <dc:creator>MicrosimBen</dc:creator>
    <dc:date>2020-04-05T13:25:11Z</dc:date>
    <item>
      <title>How can I sort the order of my group variable in SGPLOT using HBOX</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-can-I-sort-the-order-of-my-group-variable-in-SGPLOT-using/m-p/637645#M19720</link>
      <description>&lt;P&gt;I have index scores small area data and am calculating higher area based box plots using this data. When I chart my data it is arranged in alphabetical order. I want the higher level areas ordered by their box plot average (mean_all). I have SAS 7.1 and 'CATEGORYORDER=RESPASC' appears to do nothing? Am I doing something wrong - are there any suggestions? I have a total of 150 areas I'm doing box plots for so not sure formatting is something I would want to do with this many areas. I want them ordered from highest to smallest number for 'mean_all'. The required input file is included here as suburb_scores.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ben&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sgplot data=finalresult_2 dattrmap=attrmap noborder;&lt;BR /&gt;hbox pca_all /&amp;nbsp; category=ced lineattrs=(pattern=solid) whiskerattrs=(pattern=solid) whiskerpct=0&lt;BR /&gt;meanattrs=(color=black symbol=Plus) medianattrs=(color=black ) attrid=myid&amp;nbsp; CATEGORYORDER=RESPASC;&lt;BR /&gt;by gcc2;&lt;BR /&gt;yaxistable mean_all / location=inside valueattrs=(size=6)&amp;nbsp; separator labelattrs=(size=6) stat=mean ;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Apr 2020 04:18:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-can-I-sort-the-order-of-my-group-variable-in-SGPLOT-using/m-p/637645#M19720</guid>
      <dc:creator>MicrosimBen</dc:creator>
      <dc:date>2020-04-05T04:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: How can I sort the order of my group variable in SGPLOT using HBOX</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-can-I-sort-the-order-of-my-group-variable-in-SGPLOT-using/m-p/637662#M19721</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/320842"&gt;@MicrosimBen&lt;/a&gt;&amp;nbsp;and welcome to the SAS Support Communities!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instead of CATEGORYORDER= use a YAXIS statement (in the PROC SGPLOT step) with the &lt;A href="https://documentation.sas.com/?docsetId=grstatproc&amp;amp;docsetTarget=n0n6uml63c6h8dn16phbd1arm9g9.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#n0qnft5qzozjeqn166onefa438oqc" target="_blank" rel="noopener"&gt;DISCRETEORDER= option&lt;/A&gt;:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;yaxis discreteorder=data;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;As a preliminary step, you need to sort the input dataset (or create a sorted view) by &lt;FONT face="courier new,courier"&gt;descending mean_all&lt;/FONT&gt;&amp;nbsp;within the BY groups so that &lt;FONT face="courier new,courier"&gt;discreteorder=data&lt;/FONT&gt; leads to the intended sort order:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=finalresult_2;
by gcc2 descending mean_all;
run;&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Apr 2020 09:30:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-can-I-sort-the-order-of-my-group-variable-in-SGPLOT-using/m-p/637662#M19721</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-04-05T09:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: How can I sort the order of my group variable in SGPLOT using HBOX</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-can-I-sort-the-order-of-my-group-variable-in-SGPLOT-using/m-p/637679#M19722</link>
      <description>&lt;P&gt;Thanks a lot that's fantastic!&lt;/P&gt;</description>
      <pubDate>Sun, 05 Apr 2020 13:25:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-can-I-sort-the-order-of-my-group-variable-in-SGPLOT-using/m-p/637679#M19722</guid>
      <dc:creator>MicrosimBen</dc:creator>
      <dc:date>2020-04-05T13:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: How can I sort the order of my group variable in SGPLOT using HBOX</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-can-I-sort-the-order-of-my-group-variable-in-SGPLOT-using/m-p/902271#M24202</link>
      <description>&lt;P&gt;You are my sunshine, my only sunshine! Tks!&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2023 06:01:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-can-I-sort-the-order-of-my-group-variable-in-SGPLOT-using/m-p/902271#M24202</guid>
      <dc:creator>iksawffej</dc:creator>
      <dc:date>2023-11-09T06:01:52Z</dc:date>
    </item>
  </channel>
</rss>

