<?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 Simple bar chart (multiple variables) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Simple-bar-chart-multiple-variables/m-p/371081#M88642</link>
    <description>&lt;P&gt;I am able to create many types of bar charts in SAS but the simplest is escaping my grasp.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A subset of my data looks somewhat like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Year &amp;nbsp; Var1 &amp;nbsp;Var2 &amp;nbsp;Var3&lt;/P&gt;&lt;P&gt;2004 &amp;nbsp; 0.50 &amp;nbsp;0.38 &amp;nbsp;0.93&lt;/P&gt;&lt;P&gt;2005 &amp;nbsp; 0.40 &amp;nbsp;0.22 &amp;nbsp;0.88&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create (for each year) a simple bar chart that has 3 bars, one for each variable and along the same axis for its respective value, but it seems like I am able to plot everything except what I'm trying to accomplish. This is easily done in Excel but I am automating the process since I need to make many charts (I need no assistance with automation). I have tried using Year as one of the variables (after limiting my plotting to certain years using a where statement) but still to no avail. Any advice?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13995i8822D953321F7C75/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Example.png" title="Example.png" /&gt;</description>
    <pubDate>Tue, 27 Jun 2017 22:56:38 GMT</pubDate>
    <dc:creator>akhan205</dc:creator>
    <dc:date>2017-06-27T22:56:38Z</dc:date>
    <item>
      <title>Simple bar chart (multiple variables)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simple-bar-chart-multiple-variables/m-p/371081#M88642</link>
      <description>&lt;P&gt;I am able to create many types of bar charts in SAS but the simplest is escaping my grasp.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A subset of my data looks somewhat like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Year &amp;nbsp; Var1 &amp;nbsp;Var2 &amp;nbsp;Var3&lt;/P&gt;&lt;P&gt;2004 &amp;nbsp; 0.50 &amp;nbsp;0.38 &amp;nbsp;0.93&lt;/P&gt;&lt;P&gt;2005 &amp;nbsp; 0.40 &amp;nbsp;0.22 &amp;nbsp;0.88&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create (for each year) a simple bar chart that has 3 bars, one for each variable and along the same axis for its respective value, but it seems like I am able to plot everything except what I'm trying to accomplish. This is easily done in Excel but I am automating the process since I need to make many charts (I need no assistance with automation). I have tried using Year as one of the variables (after limiting my plotting to certain years using a where statement) but still to no avail. Any advice?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13995i8822D953321F7C75/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Example.png" title="Example.png" /&gt;</description>
      <pubDate>Tue, 27 Jun 2017 22:56:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simple-bar-chart-multiple-variables/m-p/371081#M88642</guid>
      <dc:creator>akhan205</dc:creator>
      <dc:date>2017-06-27T22:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: Simple bar chart (multiple variables)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simple-bar-chart-multiple-variables/m-p/371090#M88646</link>
      <description>&lt;P&gt;Why not transpose the data to a long format, via PROC TRANSPOSE. Probably the easiest method.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're using SAS Graph see the examples here&lt;/P&gt;
&lt;P&gt;&lt;A href="http://robslink.com/SAS/democd6/aaaindex.htm" target="_blank"&gt;http://robslink.com/SAS/democd6/aaaindex.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise, see the SGPLOT examples in the graph gallery&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/sassamples/graphgallery/PROC_SGPLOT.html" target="_blank"&gt;https://support.sas.com/sassamples/graphgallery/PROC_SGPLOT.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you navigate up from either of those links you'll see more examples.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 23:31:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simple-bar-chart-multiple-variables/m-p/371090#M88646</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-27T23:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: Simple bar chart (multiple variables)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simple-bar-chart-multiple-variables/m-p/371120#M88650</link>
      <description>&lt;P&gt;&amp;gt; A subset of my data looks somewhat like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Excel "data" is not data. It is a actually a report.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to make it into usable data by creatting proper variables that you can then plot.&lt;/P&gt;
&lt;P&gt;See what the data looks like in the links given by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2017 02:13:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simple-bar-chart-multiple-variables/m-p/371120#M88650</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-06-28T02:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: Simple bar chart (multiple variables)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simple-bar-chart-multiple-variables/m-p/371473#M88734</link>
      <description>&lt;P&gt;Thank you for the tranpose idea! This is what ultimately worked:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc transpose data=chart out=dataset;&lt;BR /&gt;id year;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro year (inp = );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%do i=2001 %to 2012;&lt;/P&gt;&lt;P&gt;title "&amp;amp;inp. &amp;amp;i.";&lt;/P&gt;&lt;P&gt;proc gchart data=dataset;&lt;BR /&gt;where _name_ in ("&amp;amp;inp.var1","&amp;amp;inp.var2","&amp;amp;inp.var3");&lt;BR /&gt;vbar _name_ / sumvar = _&amp;amp;i.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%mend year;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2017 21:56:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simple-bar-chart-multiple-variables/m-p/371473#M88734</guid>
      <dc:creator>akhan205</dc:creator>
      <dc:date>2017-06-28T21:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: Simple bar chart (multiple variables)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simple-bar-chart-multiple-variables/m-p/371476#M88737</link>
      <description>&lt;P&gt;Hmm...Why didn't you just do a BY statement for each year instead?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2017 22:22:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simple-bar-chart-multiple-variables/m-p/371476#M88737</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-28T22:22:39Z</dc:date>
    </item>
  </channel>
</rss>

