title: Conditional Running Total in Crystal Reports
body: <p>Using VS 2008 Crystal Reports, I would like to do a running total on a formula that is calculated on a group change. When I click on add a running total, this formula does not appear in the Available Tables and Fields list. </p>
  
  <p>This is the logic:</p>
  
  <p>On Change Group of group</p>
  
  <pre><code>if CalculatedValue &gt; 0 then
      ReportRunningTotal1 += CalculatedValue  
  else
      ReportRunningTotal2 += CalculatedValue  
  </code></pre>
  
  <p>Can I specify a condition in a running total? If not, how else could I do this? </p>
  
  <p>More info: I am doing a running total called <code>GroupRunningTotal</code> of the value of db field <code>BillableHours</code>. At change of group, I am comparing <code>GroupRunningTotal</code> to a db field for that group <code>MaxHours</code>, and I display a result of <code>MaxHours - GroupRunningTotal</code> at the group level.  </p>
  
  <p>Appropriate today - Think of it like the electoral college - the person who wins the election does not depend on total number of votes, but of number of votes in the electoral college.</p>