<?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: Latest transaction with multiple entries in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Latest-transaction-with-multiple-entries/m-p/233953#M42750</link>
    <description>What I meant was multiple payments to the same account on the same day. Like when you pay your elec bill twice on the same day.</description>
    <pubDate>Tue, 10 Nov 2015 00:42:07 GMT</pubDate>
    <dc:creator>JT99</dc:creator>
    <dc:date>2015-11-10T00:42:07Z</dc:date>
    <item>
      <title>Latest transaction with multiple entries</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Latest-transaction-with-multiple-entries/m-p/233941#M42744</link>
      <description>Hi guys! How do I get the latest payment of an account with multiple payments on the same date? I need the sum of payments if seperate payments are done on the same date.&lt;BR /&gt;&lt;BR /&gt;Acct_num Payment Pymnt_date&lt;BR /&gt;1 21 1oct2015&lt;BR /&gt;1 10 1oct2015&lt;BR /&gt;1 12 29sep2015&lt;BR /&gt;2 15 5oct201&lt;BR /&gt;2 11 3oct2015&lt;BR /&gt;&lt;BR /&gt;Latest payment of acct_num 1 should be 31 and 15 for acct_num 2.</description>
      <pubDate>Mon, 09 Nov 2015 23:36:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Latest-transaction-with-multiple-entries/m-p/233941#M42744</guid>
      <dc:creator>JT99</dc:creator>
      <dc:date>2015-11-09T23:36:51Z</dc:date>
    </item>
    <item>
      <title>Re: Latest transaction with multiple entries</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Latest-transaction-with-multiple-entries/m-p/233944#M42745</link>
      <description>&lt;P&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;select acct_num,sum(payment) as sum&lt;BR /&gt;from (select acct_num,payment,pymnt_date&lt;BR /&gt;from have group by acct_num&lt;BR /&gt;having pymnt_date=max(pymnt_date))&lt;BR /&gt;group by acct_num;&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2015 23:55:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Latest-transaction-with-multiple-entries/m-p/233944#M42745</guid>
      <dc:creator>slchen</dc:creator>
      <dc:date>2015-11-09T23:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: Latest transaction with multiple entries</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Latest-transaction-with-multiple-entries/m-p/233945#M42746</link>
      <description>&lt;P&gt;*** a non SQL solution ****;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data t_have;&lt;BR /&gt;input Acct_num Payment Pymnt_date date9.;&lt;BR /&gt;cards;&lt;BR /&gt;1 21 1oct2015&lt;BR /&gt;1 10 1oct2015&lt;BR /&gt;1 12 29sep2015&lt;BR /&gt;2 15 5oct2015&lt;BR /&gt;2 11 3oct2015&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc print data=t_a;&lt;BR /&gt;format Pymnt_date date9.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sort data=t_have; by acct_num descending Pymnt_date; run;&lt;/P&gt;&lt;P&gt;data t_want(keep=acct_num last_date sum_tot);&lt;BR /&gt;&amp;nbsp; set t_have;&lt;BR /&gt;&amp;nbsp; retain sum_tot last_date;&lt;BR /&gt;&amp;nbsp; by acct_num;&lt;BR /&gt;&amp;nbsp; if first.acct_num then do; sum_tot=0; last_date=Pymnt_date; end;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (Pymnt_date= last_date) then sum_tot+payment;&lt;BR /&gt;&amp;nbsp; if last.acct_num then output;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc print data=t_want;&lt;BR /&gt;&amp;nbsp;format last_date date9.;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Nov 2015 00:01:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Latest-transaction-with-multiple-entries/m-p/233945#M42746</guid>
      <dc:creator>billfish</dc:creator>
      <dc:date>2015-11-10T00:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: Latest transaction with multiple entries</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Latest-transaction-with-multiple-entries/m-p/233947#M42747</link>
      <description>&lt;P&gt;Why do identical amounts on the same day (but with different transaction numbers) represent the same transaction? &amp;nbsp;Couldn't a customer change his mind and go back and buy another of the same item (or perhaps another item with the same price)? &amp;nbsp;Couldn't a refund be for part of a purchase instead of the entire purchase?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Nov 2015 00:05:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Latest-transaction-with-multiple-entries/m-p/233947#M42747</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-11-10T00:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: Latest transaction with multiple entries</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Latest-transaction-with-multiple-entries/m-p/233953#M42750</link>
      <description>What I meant was multiple payments to the same account on the same day. Like when you pay your elec bill twice on the same day.</description>
      <pubDate>Tue, 10 Nov 2015 00:42:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Latest-transaction-with-multiple-entries/m-p/233953#M42750</guid>
      <dc:creator>JT99</dc:creator>
      <dc:date>2015-11-10T00:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: Latest transaction with multiple entries</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Latest-transaction-with-multiple-entries/m-p/233965#M42751</link>
      <description>You could also do a proc means by acct_num and pymt_date. Then calculate 2 metrics, total payment and number of payments per date.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Nov 2015 03:06:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Latest-transaction-with-multiple-entries/m-p/233965#M42751</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-11-10T03:06:19Z</dc:date>
    </item>
  </channel>
</rss>

