How can I build a search for contacts that match two criteria?

1) The contact has contributed in the last 30 days;


2) The contact has not contributed another donation within the last 12 months.

In other words, I'd like to select people who have donated for the first time during last 12 months.


Not sure how I would do that with a search, but in general you might want to use CiviRules for donor segmentation? Details can be found here:https://wiki.civicrm.org/confluence/display/CRMDOC/CiviRules+Cookbook with some examples.

  • Does CiviRules work good with 4.7.14? Would you kindly share a link that explains how to enable this extension?
    – Aivars
    Jan 26 '17 at 11:32
  • Enabling the extension can be done in the standard way, if you do not know how to do this I would suggest you check docs.civicrm.org/user/en/stable/introduction/extensions. Jan 26 '17 at 11:34
  • We have tested CiviRules with 4.6, although I know some organizations have tested it against 4.7. We are likely to upgrade it to 4.7 sometime this year when our customers upgrade. Jan 26 '17 at 11:35
  • Can you expand a bit about 4.7, how does it work according to your information?
    – Aivars
    Jan 29 '17 at 20:12
  • That is a strange question to me. I am not a supplier of software products but a sharer of what we made.....if it has been tested with 4.7 it does what the testers have approved? They do not report to me? Jan 30 '17 at 7:07

You should have a look at the contribution reports, particularly the SYBUNT one. Also some reports have a filter that let's you search explicitly for first contributions by a donor.

  • How can I even change the year of "This year" from 2011 which is set by default?
    – Aivars
    Jan 29 '17 at 20:11
  • 2
    You should be able to slect the current year in the "filter tab" of the sybunt report (at least I was able to do that).
    – Fabian
    Jan 30 '17 at 15:49

Sounds like a job for Summary Fields extension

It'll do lots of roll up calculations and store them to make a lot of contribution-related searches of contacts much faster.

Then you can look for contacts that have a value of "Date of Last Contribution" within the last 3 months, and have the value "Total Contributions in the Last 12 Months" equal to the amount "Amount of the last Contribution" - you can do that with the search builder for example.

  • The problem with this scenario is that "Total Contributions in the Last 12 Months" returns the donation amount (sum), not the times of donations (count). What I would need for this purpose is the option Count of Contributions in the Last 12 month in Summary Fields.
    – Aivars
    Jan 27 '17 at 14:20
  • 1
    You're right, so here's another way - look for where the Total Contributions in the Last 12 Months = The amount of the last contribution. Updating my answer above.
    – Alan Dixon
    Jan 27 '17 at 20:38
  • I get the idea, but I don't understand how can I search for Contacts whose Total Contributions in the Last 12 Months match The Amount of the Last Contribution using Search builder (or any other CiviCRM tool for that matter). Could you please explain?
    – Aivars
    Jan 29 '17 at 20:32
  • You're right again, I was indulging in wishful thinking, there's no way I can see how to compare two fields in those interfaces. Maybe back to working with the extension maintainers to see how to add a new field containing the number of contributions in the past year?
    – Alan Dixon
    Jan 30 '17 at 16:46

I'm not sure if this is possible with one search but other approach could be to save the two searches separately as smart groups and then build a new search for contacts that are in the two groups at once.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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