<?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: Plot grouped bar chart in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Plot-grouped-bar-chart/m-p/682748#M206692</link>
    <description>&lt;P&gt;What makes the height of the bar? You don't show any other values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Basic approach would be something like:&lt;/P&gt;
&lt;PRE&gt;proc sgplot data=have;
   vbar division / group=open_date groupdisplay=cluster
   &amp;lt;vertical option goes here&amp;gt;&lt;BR /&gt;   datalabel
   ;
run;&lt;/PRE&gt;
&lt;P&gt;Where I have vertical option goes here could be a variable used to create the height. That would be Response=variablename.&lt;/P&gt;
&lt;P&gt;Or a statistic calculated from the data: stat= &amp;lt;one of&amp;gt; freq mean median percent sum. Mean, median and sum require a response variable to calculate from, freq would be the number of times the category variable, division in this case, appears or percent the percent of the category variable.&amp;nbsp; The datalabel shows the value of the statistic, or a different variable, at the end of the bar.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There a lots of options involved for specific appearance and behavior.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 09 Sep 2020 20:59:24 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-09-09T20:59:24Z</dc:date>
    <item>
      <title>Plot grouped bar chart</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Plot-grouped-bar-chart/m-p/682740#M206689</link>
      <description>&lt;P&gt;Hey everyone!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have included a chart I made from Excel. Attached the group chart below. It displays the monthly frequency distributions by division. In this example it's 3 months grouped together. I'm attempting to recreate this chart with from base SAS (9.4).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have also included sample data below. Does anyone know what's the best method (like PROC GCHART, etc.) is to create this graph? I also need to display the legend as shown.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pivot_chart.JPG" style="width: 578px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/49179i537E2EF1F349428A/image-dimensions/578x298?v=v2" width="578" height="298" role="button" title="pivot_chart.JPG" alt="pivot_chart.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample data:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;division&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;open_date&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Electrophysiology&lt;/TD&gt;&lt;TD&gt;1-Mar-20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Endoscopy&lt;/TD&gt;&lt;TD&gt;1-Mar-20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Endoscopy&lt;/TD&gt;&lt;TD&gt;1-Mar-20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Endoscopy&lt;/TD&gt;&lt;TD&gt;1-Mar-20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;IC&lt;/TD&gt;&lt;TD&gt;1-Mar-20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;IC&lt;/TD&gt;&lt;TD&gt;1-Mar-20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Urology&lt;/TD&gt;&lt;TD&gt;1-Aug-20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Urology&lt;/TD&gt;&lt;TD&gt;1-Aug-20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Urology&lt;/TD&gt;&lt;TD&gt;1-Aug-20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Urology&lt;/TD&gt;&lt;TD&gt;1-Aug-20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Urology&lt;/TD&gt;&lt;TD&gt;1-Aug-20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Urology&lt;/TD&gt;&lt;TD&gt;1-Aug-20&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Wed, 09 Sep 2020 19:14:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Plot-grouped-bar-chart/m-p/682740#M206689</guid>
      <dc:creator>DipuRahman</dc:creator>
      <dc:date>2020-09-09T19:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: Plot grouped bar chart</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Plot-grouped-bar-chart/m-p/682748#M206692</link>
      <description>&lt;P&gt;What makes the height of the bar? You don't show any other values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Basic approach would be something like:&lt;/P&gt;
&lt;PRE&gt;proc sgplot data=have;
   vbar division / group=open_date groupdisplay=cluster
   &amp;lt;vertical option goes here&amp;gt;&lt;BR /&gt;   datalabel
   ;
run;&lt;/PRE&gt;
&lt;P&gt;Where I have vertical option goes here could be a variable used to create the height. That would be Response=variablename.&lt;/P&gt;
&lt;P&gt;Or a statistic calculated from the data: stat= &amp;lt;one of&amp;gt; freq mean median percent sum. Mean, median and sum require a response variable to calculate from, freq would be the number of times the category variable, division in this case, appears or percent the percent of the category variable.&amp;nbsp; The datalabel shows the value of the statistic, or a different variable, at the end of the bar.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There a lots of options involved for specific appearance and behavior.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 20:59:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Plot-grouped-bar-chart/m-p/682748#M206692</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-09-09T20:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: Plot grouped bar chart</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Plot-grouped-bar-chart/m-p/682750#M206694</link>
      <description>Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; ! Thank you for the quick response. The height of the bar is the count of "opens" for the month. So for example for Endoscopy, the count would be 3 for March-2020.&lt;BR /&gt;&lt;BR /&gt;Sounds like I could do something like stat=freq?</description>
      <pubDate>Wed, 09 Sep 2020 19:50:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Plot-grouped-bar-chart/m-p/682750#M206694</guid>
      <dc:creator>DipuRahman</dc:creator>
      <dc:date>2020-09-09T19:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: Plot grouped bar chart</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Plot-grouped-bar-chart/m-p/682760#M206699</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/322166"&gt;@DipuRahman&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; ! Thank you for the quick response. The height of the bar is the count of "opens" for the month. So for example for Endoscopy, the count would be 3 for March-2020.&lt;BR /&gt;&lt;BR /&gt;Sounds like I could do something like stat=freq?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I think you have the correct approach.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 20:03:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Plot-grouped-bar-chart/m-p/682760#M206699</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-09-09T20:03:39Z</dc:date>
    </item>
  </channel>
</rss>

