<?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: Using sum and grouping together in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Using-sum-and-grouping-together/m-p/888533#M39467</link>
    <description>&lt;P&gt;This is a job for PROC SUMMARY!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=test nway;
    class icustomerid;
    var current_balance;
    output out=want sum=;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 09 Aug 2023 10:14:31 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2023-08-09T10:14:31Z</dc:date>
    <item>
      <title>Using sum and grouping together</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-sum-and-grouping-together/m-p/888531#M39466</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I have a sample data set and I want to sum the current_balance of same icustomerid. For e.g. if there are two debt_codes with one icustomerid then I would like to see one icustomerid with the total current_balance. I am trying to find the total balance for each icustomerid. Here is the sample dataset.&lt;/P&gt;
&lt;P&gt;Data Test; &lt;BR /&gt;infile cards expandtabs; &lt;BR /&gt;input rep_code $ debt_code client_code $ Current_balance Balance_banding $ icustomerid;&lt;BR /&gt;datalines ; &lt;BR /&gt;168 245442736 3G073 47.57 £40-50 490&lt;BR /&gt;168 284369295 SUL007 7.79 £0-10 490&lt;BR /&gt;122 379059801 CAPONE150 276.21 £50+ 1234&lt;BR /&gt;122 379021629 CAPONE150 625.88 £50+ 1234&lt;BR /&gt;122 401458237 VANQUIS199 2862.77 £50+ 1234&lt;BR /&gt;122 396978322 EON067 252.35 £50+ 1234&lt;BR /&gt;168 441317245 SHOPDRCT1063 271.29 £50+ 125&lt;BR /&gt;; &lt;BR /&gt;run;&lt;BR /&gt;Can you please suggest the correct way?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2023 10:01:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-sum-and-grouping-together/m-p/888531#M39466</guid>
      <dc:creator>Sandeep77</dc:creator>
      <dc:date>2023-08-09T10:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: Using sum and grouping together</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-sum-and-grouping-together/m-p/888533#M39467</link>
      <description>&lt;P&gt;This is a job for PROC SUMMARY!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=test nway;
    class icustomerid;
    var current_balance;
    output out=want sum=;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Aug 2023 10:14:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-sum-and-grouping-together/m-p/888533#M39467</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-08-09T10:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using sum and grouping together</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-sum-and-grouping-together/m-p/888534#M39468</link>
      <description>Thank you. It worked. Just wanted to add in it that what can I do if I want to add all the columns from the previous table to this test table? For e.g. we use select * to get all the variables from the previous dataset.</description>
      <pubDate>Wed, 09 Aug 2023 10:20:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-sum-and-grouping-together/m-p/888534#M39468</guid>
      <dc:creator>Sandeep77</dc:creator>
      <dc:date>2023-08-09T10:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: Using sum and grouping together</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Using-sum-and-grouping-together/m-p/888537#M39469</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/391779"&gt;@Sandeep77&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Just wanted to add in it that what can I do if I want to add all the columns from the previous table to this test table? For e.g. we use select * to get all the variables from the previous dataset.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I don't know what you mean. Please explain further. Provide data examples and desired output.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2023 11:44:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Using-sum-and-grouping-together/m-p/888537#M39469</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-08-09T11:44:48Z</dc:date>
    </item>
  </channel>
</rss>

