title: How to sum up the columns of views table in drupal7?
body: <p>How do I put a field summary in the footer of my views (Drupal 7) view?</p>
  
  <p>So I am listing user profiles, one of the fields contain an integer value for the amount of products they will order each month.</p>
  
  <p>User1: 45<br>
  User2: 45<br>
  User3: 30</p>
  
  <p>In the footer of this view, I would like to sum up all the values from the table, so in the bottom of the "amount of products" column I would get the value 120.</p>
  
  <p>How do I best go about doing this? I am new to Drupal but fairly experienced with PHP. I have heard of custom views templates, would that be the way or is there an easier way?</p>
  
  <p>Thanks!</p>
  
  <hr>
  
  <p>Thanks,
  I'm running Drupal7 though so yet no luck with that module.</p>
  
  <p>I feel it is something easy I am trying to do here, I am really surprised that this isn't easy to accomplish.</p>
  
  <p>I took a longshot with something like this, but no luck...</p>
  
  <pre><code>if (isset($mCount_test)) {
  
      $mCount_test+=1; //if it is set, add to it
  }
  else {
      $mCount_test=0; //if this is the first step of the loop, set (create) the variable
  }
  
  //print the actual contents
  print $fields["title"]-&gt;content;
  
  //check if my sum-variable is working... (which it ain't...)
  print "[$mCount_test]";
  </code></pre>
  
  <p>I assume it has something to do with variable scope, I haven't had the time to dig down inte how views actually uses these template files.</p>
  
  <p>Would be nice if there were a template file that sort of wraps this fields-template (like page.tpl? Looks like it doesn't 'cause anything I do in that file is a no-show...) where I could set the variable, let this fields-template file add to that variable, and then back in the page.tpl print the end result from that variable at the footer of my table.</p>