3

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!

2 Answers 2

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?

1
  • 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!
    – leomelzer
    Commented May 9, 2015 at 14:49
0

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 Eileen for the hint with the contribution search, would have worked if we actually used those recurring contributions :)

1
  • I feel like I have a report somewhere that does totals on custom fields but can't quite think where right now
    – eileen
    Commented May 14, 2015 at 3:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.