<?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 SQL: Combine Multiple Row Values into One in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Combine-Multiple-Row-Values-into-One/m-p/313368#M68083</link>
    <description>&lt;P&gt;I do not necessarily need SQL. I just want to count the number By Type: This is my want table.&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;Count Number of Type&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
    <pubDate>Tue, 22 Nov 2016 07:29:30 GMT</pubDate>
    <dc:creator>Agent1592</dc:creator>
    <dc:date>2016-11-22T07:29:30Z</dc:date>
    <item>
      <title>Proc SQL: Combine Multiple Row Values into One</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Combine-Multiple-Row-Values-into-One/m-p/313365#M68080</link>
      <description>&lt;P&gt;I have the following data: How can I collapse these two rows into 1 using the SQL procedure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;Type&lt;/TD&gt;&lt;TD&gt;Rate&lt;/TD&gt;&lt;TD&gt;Amt&lt;/TD&gt;&lt;TD&gt;Trend&lt;/TD&gt;&lt;TD&gt;event&lt;/TD&gt;&lt;TD&gt;final&lt;/TD&gt;&lt;TD&gt;carryover&lt;/TD&gt;&lt;TD&gt;comment&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Text1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;0.7&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;decreasing&lt;/TD&gt;&lt;TD&gt;0.625&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Text2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Tue, 22 Nov 2016 07:10:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Combine-Multiple-Row-Values-into-One/m-p/313365#M68080</guid>
      <dc:creator>Agent1592</dc:creator>
      <dc:date>2016-11-22T07:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL: Combine Multiple Row Values into One</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Combine-Multiple-Row-Values-into-One/m-p/313366#M68081</link>
      <description>Why limit yourself to SQL?&lt;BR /&gt;Also how do you want to collapse since there are different values in the same column?&lt;BR /&gt;Pls provide a want data set.</description>
      <pubDate>Tue, 22 Nov 2016 07:14:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Combine-Multiple-Row-Values-into-One/m-p/313366#M68081</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-11-22T07:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL: Combine Multiple Row Values into One</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Combine-Multiple-Row-Values-into-One/m-p/313368#M68083</link>
      <description>&lt;P&gt;I do not necessarily need SQL. I just want to count the number By Type: This is my want table.&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;Count Number of Type&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Tue, 22 Nov 2016 07:29:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Combine-Multiple-Row-Values-into-One/m-p/313368#M68083</guid>
      <dc:creator>Agent1592</dc:creator>
      <dc:date>2016-11-22T07:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL: Combine Multiple Row Values into One</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Combine-Multiple-Row-Values-into-One/m-p/313369#M68084</link>
      <description>&lt;P&gt;I agree with&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13674"&gt;@LinusH﻿&lt;/a&gt;, but if you absolutely have to do this in sql you have to make the decision of what value you want in eg Type and Rate? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 07:31:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Combine-Multiple-Row-Values-into-One/m-p/313369#M68084</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2016-11-22T07:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL: Combine Multiple Row Values into One</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Combine-Multiple-Row-Values-into-One/m-p/313371#M68085</link>
      <description>&lt;P&gt;Like this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
   input ID Type $ Rate Amt $ Trend :$20. event	final	carryover comment $;
   infile datalines dlm = ',';
   datalines;
1,A,2  , ,          , , ,     ,Text1
1,B,0.7, ,decreasing, , ,0.625,Text2
;

proc sql;
   create table want as
   select ID
         ,count(ID) as Count label = 'Count Number of Type'
   from have
   group by ID;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 Nov 2016 07:44:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Combine-Multiple-Row-Values-into-One/m-p/313371#M68085</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2016-11-22T07:44:28Z</dc:date>
    </item>
  </channel>
</rss>

