title: Moving Distinct Count in Big Query (SQL syntax)
body: <p>I have sort of a weird one for all the SQL masters out there. I need to get the distinct count of items in a moving window of 14 days. I tried dense_rank but it didn't specify (or I did not know how to) specify the 14  day moving window.</p>
  <p>For simplicity my dataset has 3 columns.</p>
  <ol>
  <li>store     (string)</li>
  <li>item code (string)</li>
  <li>date      (date)</li>
  </ol>
  <p>A quick example of my endo goal would be the following:</p>
  <ul>
  <li>Day 1 I scan items 1,2,3,4</li>
  <li>Day 2 I scan items 2,3,4,5</li>
  <li>Day 3 I scan items 1,6</li>
  </ul>
  <p>So then for day 1 my uniques would be 4, Day 2 my uniques would be 5 and day 3 my uniques would be 6 (1,2,3,4,5,6)</p>
  <p>Once I get to day 15 I would ignore values found in day 1 and only take days 2-15</p>
  <p>Any and all help would be greatly appreciated.</p>