<?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 sum by group in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/sum-by-group/m-p/748545#M235081</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have this table&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data example;&lt;BR /&gt;input account_Nbr rate_StartDate date9. typecode rate_id Amount;&lt;BR /&gt;format rate_StartDate date9.;&lt;BR /&gt;Cards;&lt;BR /&gt;&lt;STRONG&gt;130 06Jan1999 10 10062 1700.9600&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;130 01Jan1990 10 10063 17766.9800&lt;/STRONG&gt;&lt;BR /&gt;130 29Jul2005 11 14414 51.5900&lt;BR /&gt;&lt;STRONG&gt;130 01Jan1990 11 10063 998.5000&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;130 06Jan1999 11 10062 160.5300&lt;/STRONG&gt;&lt;BR /&gt;130 02Apr2013 11 76522 0.0900&lt;BR /&gt;130 01May2003 11 10526 22.1700&lt;BR /&gt;130 01Jul2000 11 10061 249.9610&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In output table i need to get only 2 columns &lt;BR /&gt;&lt;BR /&gt;condition &lt;BR /&gt;when there is a typecode ="10", take typecode = "11" that have the same Rate_ID and calculate total amount &lt;BR /&gt;&lt;BR /&gt;This means &lt;BR /&gt;column 1 will have sum of total amount when rate_id is same i.e 1062 for typecode = 10 and typecode = 11 &lt;BR /&gt;column 2 will have sum of total amount when rate_id is same i.e 1063 for typecode = 10 and typecode = 11 &lt;BR /&gt;&lt;BR /&gt;Please help.&lt;/P&gt;</description>
    <pubDate>Wed, 16 Jun 2021 20:01:20 GMT</pubDate>
    <dc:creator>Aexor</dc:creator>
    <dc:date>2021-06-16T20:01:20Z</dc:date>
    <item>
      <title>sum by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sum-by-group/m-p/748545#M235081</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have this table&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data example;&lt;BR /&gt;input account_Nbr rate_StartDate date9. typecode rate_id Amount;&lt;BR /&gt;format rate_StartDate date9.;&lt;BR /&gt;Cards;&lt;BR /&gt;&lt;STRONG&gt;130 06Jan1999 10 10062 1700.9600&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;130 01Jan1990 10 10063 17766.9800&lt;/STRONG&gt;&lt;BR /&gt;130 29Jul2005 11 14414 51.5900&lt;BR /&gt;&lt;STRONG&gt;130 01Jan1990 11 10063 998.5000&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;130 06Jan1999 11 10062 160.5300&lt;/STRONG&gt;&lt;BR /&gt;130 02Apr2013 11 76522 0.0900&lt;BR /&gt;130 01May2003 11 10526 22.1700&lt;BR /&gt;130 01Jul2000 11 10061 249.9610&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In output table i need to get only 2 columns &lt;BR /&gt;&lt;BR /&gt;condition &lt;BR /&gt;when there is a typecode ="10", take typecode = "11" that have the same Rate_ID and calculate total amount &lt;BR /&gt;&lt;BR /&gt;This means &lt;BR /&gt;column 1 will have sum of total amount when rate_id is same i.e 1062 for typecode = 10 and typecode = 11 &lt;BR /&gt;column 2 will have sum of total amount when rate_id is same i.e 1063 for typecode = 10 and typecode = 11 &lt;BR /&gt;&lt;BR /&gt;Please help.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jun 2021 20:01:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sum-by-group/m-p/748545#M235081</guid>
      <dc:creator>Aexor</dc:creator>
      <dc:date>2021-06-16T20:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: sum by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sum-by-group/m-p/748551#M235085</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
	create table totals as select rate_id, sum(amount) as total
		from example
		where rate_id in (10062, 10063)
		group by rate_id;
quit;

proc transpose data=totals out=totals_t;
	id rate_id;
	var total;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Does this get what you want?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jun 2021 20:23:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sum-by-group/m-p/748551#M235085</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2021-06-16T20:23:08Z</dc:date>
    </item>
  </channel>
</rss>

