+ Start a Discussion
amrutha kommuriamrutha kommuri 

Build a report Filtering based on Child records

Hi all,

I have a Parent (Contact) and Child ( Program Enrollments).  A Contact can have multiple Program Enrollments and Each of them can have a different Program Name. I want to filter the contacts that have Program Enrollments with Program Name = "VWISE" but not have Program Enrollments with Program Name= "EBV".

How can I achieve this??

I appreciate your time and help!

Best,
Amrutha
Best Answer chosen by amrutha kommuri
@anilbathula@@anilbathula@
Hi amrutha kommuri,

Then you need have check box on contact and write a trigger on program .
When ever a program is cretaed and check for the count of programs related to that contact ,
If the contact has only one program with name ==EBV make the check box to true.
And use this check box in report to filter the records.

Thanks
Anil.B
 

All Answers

@anilbathula@@anilbathula@
Hi amrutha kommuri,

create a custom report type with primary object as contact and secondary object as (program Enrollments) .
And select the criteria as "Each "A" record must have at least one related "B" record."
Now create your report using the new report type here you can use filters on child object fields.
https://certifiedondemand.com/report-types/

Thanks
Anil.B
amrutha kommuriamrutha kommuri
Thanks anil again. But I quite did not understand. 

For example, 

Contact -  Ammy has 2 Program Enrollments

Program Enrollment 1 - VWISE Program name

Program Enrollment 2 - EBV Program Name

Contact - Tammy has 1 program Enrollment

Program Enrollment - VWISE Program Name


I want to have Tammy in the report but not Ammy since she has a Program Enrollment with Program Name ==EBV

I hope it makes sense.
@anilbathula@@anilbathula@
Hi amrutha kommuri,

Then you need have check box on contact and write a trigger on program .
When ever a program is cretaed and check for the count of programs related to that contact ,
If the contact has only one program with name ==EBV make the check box to true.
And use this check box in report to filter the records.

Thanks
Anil.B
 
This was selected as the best answer
amrutha kommuriamrutha kommuri
Thank you Anil. I will try. 
Aarthy SivaramakrishnanAarthy Sivaramakrishnan
Hello All,

I have a same scenario of building a report for Contacts with program enrollments With course connections:

I have build the custom report type based on the above conditions where Contacts has multiple program enrollments and course connections.

The report lists contacts with mutiple enrollments but I need to filter based on the enrollments:

EG:

Contact -  Ammy has 2 Program Enrollments

Program Enrollment 1 - VWISE Program name

Program Enrollment 2 - EBV Program Name



Contact - Tammy has 1 program Enrollment

Program Enrollment - VWISE Program Name


I need count of program enrollments along with the contact details to be built on the report as below:

I tried using the formula's and cross filters but I couldnt fetch the count of program enrollments for one contact :

Report should be something like this below:

Name    Address     Email   Phone Programenrollment  count

Any help is much appreciated!!!

Thanks