title: How to sum specific rows in iReport with query?
body: <p>I'm trying to create a summary table using iReport.  My dataset is returning a list of purchases made and prices.  Something like</p>
  
  <p><code>Milk, $1.23</code></p>
  
  <p><code>Chicken, $5.45</code></p>
  
  <p><code>Milk, $1.44</code>  </p>
  
  <p>and so on.  I want my table to be able to breakdown my item by product.  I want a table with columns:</p>
  
  <ul>
  <li># of times product was purchased (#rows where product milk), </li>
  <li>total dollar amount spent on the product (sum of prices where product is milk),</li>
  <li>and average price of product (column 2 divided by column 1).</li>
  </ul>
  
  <p>How can I do this?  I have been playing around with variables and I can get a total sum of all prices, but I don't know how to do this with a subset of the data using a more complex query.  </p>