How can I use the OR operator in a Participants report? I need a simple A OR B report, and I can only find how to do A AND B.
-
Run the report twice, once for A once for B, and combine in excel?– DemeritMay 13, 2018 at 16:30
-
If it was me - no problem. But this report is run daily by the office people, and I don't want them to run 2 different reports, because the outcome of the report means the same for both conditions. I don't want to inflict my technical issue onto my end-users.– EladMay 13, 2018 at 17:29
-
If you're willing to write an extension you could make a copy of CRM/Report/Form/Event/ParticipantListing.php and in the where() function change the line (#603) where it ANDs the clauses together to an OR.– DemeritMay 13, 2018 at 19:20
-
2Could you please clarify your question? Using the "Is One Of" filter allows you to select two values, and the presence of either will put them on the report. While that answers the question as it's asked, I imagine you're asking something slightly different.– Jon G - Megaphone TechMay 13, 2018 at 20:09
-
I mean an OR based condition that is not just 1 value of a few options of the same field, but actually 2 composite conditions, with an OR between them. Something like: If 'Arrival Date' (custom field a) is within the next 7 days OR ('Event Type' equals X AND 'Event Date' is within the next 7 days)– EladMay 14, 2018 at 8:16
1 Answer
What you're asking isn't supported with CiviReport, unfortunately.
You have a couple of alternative options:
- You can build a Smart Group that meets your criteria, then filter by the Smart Group. However, I'm not sure what the current state of relative date filters and smart groups is these days, so this may not work.
- You can integrate a more advanced reporting engine like Hitachi Vantara or Tableau.
- If you're using Drupal as your CMS, you can build a View with CiviCRM integration to provide the report you need.
-
I also wanted to use OR and not AND in a report - see civicrm.stackexchange.com/questions/24637/… Of course, Advanced Search can use OR so setting up a smart group as suggested by Jon G may work May 14, 2018 at 19:52