title: Variable Expression: Count all records where condition >0 is met
body: <p>I created a variable to keep a count of all machinery_part_id in a location for my report.  This works fine, now I want to add a filter where the machinery_part_id is only counted if they have a quantity > 0.</p>
  
  <p><strong>This is what I had to start with:</strong></p>
  
  <p>Variable Name: PART_COUNT</p>
  
  <p>Variable Class Type: Java.lang.Integer</p>
  
  <p>Calculation Type: Count</p>
  
  <p>Reset Type: Group</p>
  
  <p>Reset Group: LOCATION_ID</p>
  
  <p>Increment Type: None</p>
  
  <p>Variable Expression: $F{MACHINERY_PART_ID}</p>
  
  <p><strong>A field in my report was set up as follows:</strong></p>
  
  <p>Text Field Expression Class: Java.lang.Integer</p>
  
  <p>Evaluation Time: Group</p>
  
  <p>Evaluation Group: LOCATION_ID</p>
  
  <p>Text Field Expression: $V{PART_COUNT}</p>
  
  <p>The new condition is count(machinery_part_id) group by location_id having quantity >0</p>
  
  <p><code>$F{MACHINERY_PART_ID}</code> and <code>$F{QUANTITY_SENT}</code> are both <code>java.lang.double</code> fields, I tried entering the following in the Variable Expression:</p>
  
  <pre><code>New Double($F{QUANTITY_SENT} &gt; 0.00 ?  $F{QUANTITY_SENT}.doubleValue() : 0d)
  </code></pre>
  
  <p><strong>But it errors out with:</strong> </p>
  
  <pre><code>Syntax error, insert ";" to complete BlockStatements
  </code></pre>
  
  <p>I'm using iReport 3.0.0</p>
  
  <p>Please help,
  Thanks!</p>