<?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: sgplot sorting by frequency in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-sorting-by-frequency/m-p/685699#M20500</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/219549"&gt;@zimcom&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Add the &lt;A href="https://documentation.sas.com/?docsetId=grstatproc&amp;amp;docsetTarget=n1wvtdp1zvu57un1wjyheyd61e3i.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#p14mwpmr7ycybcn10rkqzq0pn8iwb" target="_blank" rel="noopener"&gt;CATEGORYORDER=&lt;/A&gt; option to the existing options (DATALABEL and FILLATTRS=...) of the HBAR statement:&lt;/P&gt;
&lt;PRE&gt;categoryorder=respdesc&lt;/PRE&gt;
&lt;P&gt;to sort by descending frequencies or&lt;/P&gt;
&lt;PRE&gt;categoryorder=respasc&lt;/PRE&gt;
&lt;P&gt;to sort by ascending frequencies.&lt;/P&gt;</description>
    <pubDate>Tue, 22 Sep 2020 14:10:40 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2020-09-22T14:10:40Z</dc:date>
    <item>
      <title>sgplot sorting by frequency</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-sorting-by-frequency/m-p/685696#M20499</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am creating a bar graph using the following sgplot, the bar graph generated is sorted by the&amp;nbsp;aedecod&amp;nbsp;alphabetically, but I really want to bar graph sorted by the frequency of the aedecod,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sgplot data=SAE;&lt;BR /&gt;hbar aedecod / datalabel&lt;BR /&gt;fillattrs=graphdata2;&lt;BR /&gt;yaxis display=(nolabel);&lt;BR /&gt;xaxis grid;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much!!&lt;/P&gt;</description>
      <pubDate>Tue, 22 Sep 2020 13:54:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-sorting-by-frequency/m-p/685696#M20499</guid>
      <dc:creator>zimcom</dc:creator>
      <dc:date>2020-09-22T13:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot sorting by frequency</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-sorting-by-frequency/m-p/685699#M20500</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/219549"&gt;@zimcom&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Add the &lt;A href="https://documentation.sas.com/?docsetId=grstatproc&amp;amp;docsetTarget=n1wvtdp1zvu57un1wjyheyd61e3i.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#p14mwpmr7ycybcn10rkqzq0pn8iwb" target="_blank" rel="noopener"&gt;CATEGORYORDER=&lt;/A&gt; option to the existing options (DATALABEL and FILLATTRS=...) of the HBAR statement:&lt;/P&gt;
&lt;PRE&gt;categoryorder=respdesc&lt;/PRE&gt;
&lt;P&gt;to sort by descending frequencies or&lt;/P&gt;
&lt;PRE&gt;categoryorder=respasc&lt;/PRE&gt;
&lt;P&gt;to sort by ascending frequencies.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Sep 2020 14:10:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-sorting-by-frequency/m-p/685699#M20500</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-09-22T14:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot sorting by frequency</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-sorting-by-frequency/m-p/685703#M20501</link>
      <description>Thank you so much!!!&lt;BR /&gt;&lt;BR /&gt;Another wish to have, can i add the total count in the graph title?&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Sep 2020 14:15:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-sorting-by-frequency/m-p/685703#M20501</guid>
      <dc:creator>zimcom</dc:creator>
      <dc:date>2020-09-22T14:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot sorting by frequency</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-sorting-by-frequency/m-p/685724#M20502</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/219549"&gt;@zimcom&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Another wish to have, can i add the total count in the graph title?&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Sure. I would probably use a preliminary (DATA or PROC SQL) step to determine the total count and assign it to a macro variable. A reference to this macro variable could then be used in the TITLE statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example -- assuming that the number of observations in dataset SAE equals the total count you need:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
call symputx('nSAE',n);
stop;
set sae nobs=n; 
run;

title "SAE frequencies (total=&amp;amp;nSAE)";&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 Sep 2020 14:40:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-sorting-by-frequency/m-p/685724#M20502</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-09-22T14:40:55Z</dc:date>
    </item>
  </channel>
</rss>

