title: Using Previous Record Function in Formula and then creating a Group Summary
body: <p>I have been trying to figure this out and I am stumped. I am finding the difference in minutes between two times by using the following formula:</p>
  
  <p>This formula is called {@CALCULATIONS}</p>
  
  <pre><code>if {Location.Name} = previous ({Location.Name}) then 
    ( hour({DownloadData.Date}) * 60 + minute({DownloadData.Date}) )-
    ( hour(previous({DownloadData.Date})) * 60 + minute(previous({DownloadData.Date})) ) 
  else 
    0
  </code></pre>
  
  <p>I then uses the answer it comes up with in a formula that determines if it meets a criteria. If it does I assign it a 1 if not I assign it a zero. Here are the 5 different formulas I have for time ranges. </p>
  
  <pre><code>{@1 to 30} if {@Calculations} in 1 to 30 then 1 else 0
  {@31 to 45} if {@Calculations} in 31 to 45 then 1 else 0
  {@46 to 60} if {@Calculations} in 46 to 60 then 1 else 0
  {@61 to 90} if {@Calculations} in 61 to 90 then 1 else 0
  {@Morethan90} if {@Calculations} &gt;90 then 1 else 0
  </code></pre>
  
  <p>For a while I have been trying to figure out how to get it to total the 1s that meet the formula criteria in the group.</p>
  
  <p>Any suggestions?</p>