title: How to measure an average count from a set of days each with their own data points, in SQL/LookerML
body: <p>I have the following table:</p>
  <pre><code>id | decided_at        | reviewer
  1    2020-08-10 13:00   john
  2    2020-08-10 14:00   john
  3    2020-08-10 16:00   john
  4    2020-08-12 14:00   jane
  5    2020-08-12 17:00   jane
  6    2020-08-12 17:50   jane
  7    2020-08-12 19:00   jane
  </code></pre>
  <p>What I would like to do is get the difference between the <code>min</code> and <code>max</code> for each day and get the total <code>count</code> from the id's that are the min, the range between min and max, and the max. Currently, I'm only able to get this data for the past day.</p>
  <p>Desired output:</p>
  <pre><code>Date       | Time(h) | Count | reviewer
  2020-08-10   3         3       john
  2020-08-12   5         4       jane
  </code></pre>
  <p>From this, I would like to get the average show this data over the past x number of days.</p>
  <p>Example:
  If today was the 13th, filter on the past 2 days (48 hours)
  Output:</p>
  <pre><code>reviewer | reviews/hour
  jane        5/4 = 1.25
  </code></pre>
  <p>Example 2:
  If today was the 13th, filter on the past 3 days (48 hours)</p>
  <pre><code>reviewer | reviews/hour
  john       3/3 = 1
  jane       5/4 = 1.25
  </code></pre>
  <p>Ideally, if this is possible in LookML <strong>without</strong> the use of a derived table, it would be nicest to have that. Otherwise, a solution in SQL would be great and I can try to convert to LookerML.</p>
  <p>Thanks!</p>