Answers.Body: <p>Turns out we were implementing recurring payments in our own way not using the standard in CiviCRM. Custom fields were involved, so in the end I decided to write a custom SQL query to sum all the relevant values. </p>
  
  <p>Maybe the summary fields module would be something people are also looking for to solve similar problems: <a href="https://github.com/progressivetech/net.ourpowerbase.sumfields" rel="nofollow">https://github.com/progressivetech/net.ourpowerbase.sumfields</a></p>
  
  <p>Thanks to Eileen for the hint with the contribution search, would have worked if we actually used those recurring contributions :)</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-14T03:54:31.537Z
Answers.Text: I feel like I have a report somewhere that does totals on custom fields but can't quite think where right now
Answers.UserDisplayName: eileen
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-09T14:54:52.133Z
Answers.LastActivityDate: 2015-05-09T14:54:52.133Z
Answers.UserDisplayName: leomelzer
Answers.Body: <p>In terms of an aggregation of actual contributions - in the contribution search (version 4.5+) it's possible to use recurring contribution dates in your criteria. The contribution search results page includes a total &amp; count.</p>
  
  <p>That doesn't really answer your 'one membership should only be counted once' though. I'm not sure I understand that requirement. It seems like you only want to count one payment per person? If you only searched within a particular time period perhaps you would exclude the others?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-09T14:49:01.977Z
Answers.Text: Thanks so much for your answer, Eileen. This steered me in the right direction as in I realized we don't use recurring payments at all. It's implemented via custom fields and then used internally to generate files for processing at the bank. The custom fields can not be searched / aggregated as nicely.
  I ended up writing a SQL query which was the most efficient way as we really only needed these data points. Thanks for your help!
Answers.UserDisplayName: leomelzer
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-04T11:01:14.597Z
Answers.LastActivityDate: 2015-05-04T11:01:14.597Z
Answers.UserDisplayName: eileen
Body: <p>I volunteer for a NGO and we try to accomplish the following: we want to aggregate the sum of all current recurring contributions (of type=X) over all members. It doesn't matter what status they have (paid, pending...) but one member should only be counted once. <strong>It's a snapshot with the result of one single value of all the recurring contributions, so to say.</strong></p>
  
  <p>I looked through the available reports in the dashboard and went through the different API methods. It seems like it would be possible to get all contacts through the API and then loop over their contributions (complexity!) to aggregate the sum, but I thought there would be a nicer way?!</p>
  
  <p>Any recommendations on how to accomplish this? Any hint is appreciated, thanks!</p>
  
Tags: <civicontribute><contributions><recurring-contributions>
Title: Sum of recurring contributions
ThreadText: # Sum of recurring contributions
  
  (Asked by: username_0 on 2015-05-04)
  
  I volunteer for a NGO and we try to accomplish the following: we want to aggregate the sum of all current recurring contributions (of type=X) over all members. It doesn't matter what status they have (paid, pending...) but one member should only be counted once. **It's a snapshot with the result of one single value of all the recurring contributions, so to say.**
  
  I looked through the available reports in the dashboard and went through the different API methods. It seems like it would be possible to get all contacts through the API and then loop over their contributions (complexity!) to aggregate the sum, but I thought there would be a nicer way?!
  
  Any recommendations on how to accomplish this? Any hint is appreciated, thanks!
  
  **Tags:** civicontribute, contributions, recurring-contributions
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2015-05-09. Score: 0 | Accepted answer
  
  Turns out we were implementing recurring payments in our own way not using the standard in CiviCRM. Custom fields were involved, so in the end I decided to write a custom SQL query to sum all the relevant values.
  
  Maybe the summary fields module would be something people are also looking for to solve similar problems: <https://github.com/progressivetech/net.ourpowerbase.sumfields>
  
  Thanks to username_1 for the hint with the contribution search, would have worked if we actually used those recurring contributions :)
  
  > **Comments:**
  > **username_1**: I feel like I have a report somewhere that does totals on custom fields but can't quite think where right now  
  
  ---
  
  ### Answer by username_1 on 2015-05-04. Score: 2
  
  In terms of an aggregation of actual contributions - in the contribution search (version 4.5+) it's possible to use recurring contribution dates in your criteria. The contribution search results page includes a total & count.
  
  That doesn't really answer your 'one membership should only be counted once' though. I'm not sure I understand that requirement. It seems like you only want to count one payment per person? If you only searched within a particular time period perhaps you would exclude the others?
  
  > **Comments:**
  > **username_0**: Thanks so much for your answer, username_1. This steered me in the right direction as in I realized we don't use recurring payments at all. It's implemented via custom fields and then used internally to generate files for processing at the bank. The custom fields can not be searched / aggregated as nicely. I ended up writing a SQL query which was the most efficient way as we really only needed these data points. Thanks for your help!  
  
  ---
  
  