title: Filtering within an window function (over ... partition by)?
body: <p>I am  trying to use a sum() over (partition by) but filter within that summing. My use case is summing trailing twelve months up to a single month's entry for each product, so:</p>
  
  <pre><code>ITEM    MONTH    SALES
  Item A  1/1/2011     2
  Item A  2/1/2011     5
  Item A  3/1/2011     3
  Item A  4/1/2011     7
  Item A  5/1/2011    12
  Item A  6/1/2011     8
  Item A  7/1/2011     9
  Item A  8/1/2011    15
  Item A  9/1/2011     6
  Item A  10/1/2011    7
  Item A  11/1/2011   12
  Item A  12/1/2011    1
  Item A  1/1/2012     3
  Item A  2/1/2012     4
  Item A  3/1/2012     5
  Item A  4/1/2012     6
  Item A  5/1/2012     4
  Item A  6/1/2012     8
  Item A  7/1/2012     9
  Item A  8/1/2012    12
  Item A  9/1/2012    14
  Item A  10/1/2012    8
  Item A  11/1/2012   12
  Item A  12/1/2012   16
  </code></pre>
  
  <p>Would then return:</p>
  
  <pre><code>ITEM      MONTH_BEGIN SALES TTM SALES
  Item A    1/1/2012        3        87
  Item A    2/1/2012        4        88
  Item A    3/1/2012        5        87
  Item A    4/1/2012        6        89
  </code></pre>
  
  <p>Where the TTM SALES for 1/1/12 is the sum of 1/1/11-12/1/11</p>