title: Sum of Function Results
body: <p>I have a report that is generating a table. Ideally it should look like</p>
  
  <pre><code>+----+------+------+------+------+-------+
  |    | Day1 | Day2 | Day3 | Day4 | Total |
  +----+------+------+------+------+-------+
  | C  | 5    | 5    | 5    | 5    | 20    |
  | R  | $100 | $100 | $100 | $100 | $400  |
  | CR | $500 | $500 | $500 | $500 | $2000 |
  +----+------+------+------+------+-------+
  </code></pre>
  
  <p>Where <code>CR</code> is the <code>C * R</code> (this works), Total for C &amp; R is <code>Sum(C)</code> (or R respectively, this works).</p>
  
  <p>The issue is Total for CR. I should get $2000, but if I do <code>Sum(C) * Sum(R)</code> I get $8000. This is obviously because it's multiplying $400 * 20. Since CR is the results of a formula, I can't do <code>Sum(CR)</code>, it's not a field like C or R is.</p>
  
  <p>What formula do I need to use to get the expected result?</p>
  
  <p><strong>Edited to add</strong></p>
  
  <p>C &amp; R are each respectively formed by day as <code>Sum(C) or Sum(R)</code>. Each Day is a group in the report, with Total being outside the group.</p>
  
  <p><a href="https://i.stack.imgur.com/ICyAG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ICyAG.png" alt="enter image description here"></a></p>
  
  <p>C translates to Contract, R to Rate and CR to Contract Revenue. Where it has &lt;> at top by Totals is the Days.</p>