title: Vertica Analytic function to count instances in a window
body: <p>Let's say I have a dataset with two columns: <code>ID</code> and <code>timestamp</code>. My goal is to count return IDs that have at least n timestamps in any 30 day window.  </p>
  
  <p>Here is an example:</p>
  
  <pre><code>ID Timestamp
  1  '2019-01-01'
  2  '2019-02-01'
  3  '2019-03-01'
  1  '2019-01-02'
  1  '2019-01-04'
  1  '2019-01-17'
  </code></pre>
  
  <p>So, let's say I want to return a list of IDs that have 3 timestamps in any 30 day window.</p>
  
  <p>Given above, my resultset would just be ID = 1.  I'm thinking some kind of windowing function would accomplish this, but I'm not positive. </p>
  
  <p>Any chance you could help me write a query that accomplishes this?</p>