Number of active donors (given in last two years) 2

PHOTO EMBED

Thu Sep 29 2022 16:33:27 GMT+0000 (Coordinated Universal Time)

Saved by @Matt_Stone #gigkpi

select
Donor_Contact__r.Country_of_Ownership__c, 
COUNT_DISTINCT(Donor_Contact__r.Id) The_Count  
 
from Opportunity

where
Donor_Contact__r.npo02__LastCloseDate__c< LAST_n_MONTHS:24
AND
RecordTypeId IN ('0122X000000ie1A','012w00000006jGy','012w00000006jGe','012w00000006jGo','012w0000000MQol','012w0000000MQuZ','012w0000000hbgn')
and
Amount>0
AND
StageName IN ('Posted','Refunded','Failed','Refund','Reversal') 
AND
Donor_Contact__r.Donor_Status__c IN ('Active','Lapsed','Laspsing') 
AND 
Donor_Contact__r.CIWF_Digital_Test_Account__c = FALSE

Group by 
Donor_Contact__r.Country_of_Ownership__c
content_copyCOPY