title: Listing Transactions that Exceed Sum Threshold
body: <p>I work for a credit card company.  Our database has a customer table and a transaction table. Fields in the customer table are SSN and CustomerKey.  Fields in the transaction table are CustomerKey, transaction date (Transdate), and transaction amount (TransAmt).</p>
  
  <p>I need a report that can list each transaction for each ssn where the sum of the transaction amounts > 1000 within a two day period in 2012. </p>
  
  <p>Here is an example of the raw data in the Transaction Table:</p>
  
  <pre><code>Trans#-----CustKey-----Date--------Amount
  1-----------12345----01/01/12--------$600
  2-----------12345----01/02/12--------$500
  3-----------67890----01/03/12--------$700
  4-----------12345----04/01/12--------$600
  5-----------67890----04/02/12--------$600
  </code></pre>
  
  <p>Here is an example of the raw data in the Customer Table:</p>
  
  <pre><code>CustKey-----SSN
  12345------123456789
  67890------123456789
  </code></pre>
  
  <p>Here are the results I need:</p>
  
  <pre><code>Trans#------SSN---------Date---------Amount---Group Key
  1--------123456789----01/01/12---------$600--------1
  2--------123456789----01/02/12---------$500--------1 
  2--------123456789----01/02/12---------$500--------2 
  3--------123456789----01/03/12---------$700--------2
  4--------123456789----04/01/12---------$600--------3
  5--------123456789-----04/02/12--------$600--------3
  </code></pre>
  
  <p>As you can see in my results, Trans# 2 is listed twice as it was part of a group of transaction that exceeded $1000 in 2 days. Each group of transaction that exceeded 1000 is identified by a group key.</p>