title: How I get SUM in core data
body: <p>I have core data with entity (Deductions) it has three attributes first one (deductionName) second is (deductionStatus) and the last one is (deductionAmount).</p>
  
  <p>Now I would like to get the SUM of (deductionAmount) if the (deductionStatus) == 1</p>
  
  <p>(deductionStatus) is a boolean.</p>
  
  <pre><code>return [[[self.fetchedDeductionData fetchedObjects] valueForKeyPath:@"@sum.deductionAmount"]floatValue];
  </code></pre>