<?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: Proc Transpose Confusion in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Proc-Transpose-Confusion/m-p/776967#M15550</link>
    <description>&lt;P&gt;Note that a question about programming should be directed to the &lt;STRONG&gt;SAS Programming&lt;/STRONG&gt; community. That will ensure that the right folks see the message.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Oct 2021 13:24:07 GMT</pubDate>
    <dc:creator>Madelyn_SAS</dc:creator>
    <dc:date>2021-10-28T13:24:07Z</dc:date>
    <item>
      <title>Proc Transpose Confusion</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Proc-Transpose-Confusion/m-p/776906#M15547</link>
      <description>&lt;P&gt;Hi, my data currently looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Country----Gold-----Silver------Bronze&lt;/P&gt;&lt;P&gt;US---------10---------12--------------15&lt;/P&gt;&lt;P&gt;China-------15--------10-------------4&lt;/P&gt;&lt;P&gt;GB----------7---------4-------------12&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want it to look like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Country------Medal-------Count&lt;/P&gt;&lt;P&gt;US----------Gold------------X&lt;/P&gt;&lt;P&gt;US---------Silver------------Y&lt;/P&gt;&lt;P&gt;US----------Bronze---------Z&lt;/P&gt;&lt;P&gt;China&lt;/P&gt;&lt;P&gt;China&lt;/P&gt;&lt;P&gt;China&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An so on and so forth. the reason for this is that I need to make 1 bar chart for the 3 different countries with each of the 3 medal counts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried using proc transpose but it seems I am doing something wrong. here is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC TRANSPOSE DATA=olympics OUT=medal;&lt;BR /&gt;ID Country_Name;&lt;BR /&gt;var gold silver bronze;&lt;BR /&gt;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated&lt;/P&gt;</description>
      <pubDate>Thu, 28 Oct 2021 07:11:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Proc-Transpose-Confusion/m-p/776906#M15547</guid>
      <dc:creator>pramenon1</dc:creator>
      <dc:date>2021-10-28T07:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose Confusion</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Proc-Transpose-Confusion/m-p/776912#M15548</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Country $ Gold Silver Bronze;
datalines;
US    10 12 15
China 15 10 4
GB    7  4  12
;

proc sort data = have;
   by Country;
run;

proc transpose data = have out = want(rename = (_NAME_ = Medal COL1 = Count));
   by Country;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Oct 2021 07:38:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Proc-Transpose-Confusion/m-p/776912#M15548</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-10-28T07:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose Confusion</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Proc-Transpose-Confusion/m-p/776913#M15549</link>
      <description>&lt;P&gt;Or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Country $ Gold Silver Bronze;
datalines;
US    10 12 15
China 15 10 4
GB    7  4  12
;

data want(keep = Country Medal Count);
   set have;
   array m Gold -- Bronze;
   do over m;
      Medal = vname(m);
      Count = m;
      output;
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Oct 2021 07:41:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Proc-Transpose-Confusion/m-p/776913#M15549</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-10-28T07:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose Confusion</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Proc-Transpose-Confusion/m-p/776967#M15550</link>
      <description>&lt;P&gt;Note that a question about programming should be directed to the &lt;STRONG&gt;SAS Programming&lt;/STRONG&gt; community. That will ensure that the right folks see the message.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Oct 2021 13:24:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Proc-Transpose-Confusion/m-p/776967#M15550</guid>
      <dc:creator>Madelyn_SAS</dc:creator>
      <dc:date>2021-10-28T13:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose Confusion</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Proc-Transpose-Confusion/m-p/776970#M15551</link>
      <description>&lt;P&gt;The ID statement is for telling PROC TRANSPOSE which variable to use to name the new columns.&lt;/P&gt;
&lt;P&gt;You want a BY statement.&amp;nbsp; If you data is not sorted by COUNTRY_NAME then add the NOTSORTED keyword to the BY statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC TRANSPOSE DATA=olympics name=Country
  OUT=medal(rename=(col1=Count)) 
;
  by Country_Name notsorted ;
  var gold silver bronze;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Oct 2021 13:49:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Proc-Transpose-Confusion/m-p/776970#M15551</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-10-28T13:49:41Z</dc:date>
    </item>
  </channel>
</rss>

