How to suppress Detail under certain conditions

I have a Crystal earnings report.  There are 3 groups:  Employee, period end date and pay code.  I want to see the full detail ONLY if the employee had pay codes 110 AND 115.  They may have other pay codes as part of their detail which is fine because I need to see the full detail but only if that detail contains pay codes 110 AND 115.   Otherwise, I want to suppress the detail.  Is this possible?  Thanks
Who is Participating?

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
Create a formula

//@PayCodes
If {payCode} in [110, 115] Then 1

Then add a summary on this field fro the employy group

Finally go to Report -> selection formulas -> group and add the formula

Sum({paycode, employee}) = 0

This should do the job
Commented:
Actually the formula in the group selection should be

Sum({paycode, employee}) > 0

Group selection select when the result is true rather than suppressing which is wht we generally do.
Be aware that the group selection only suppresses the other records so if you need to do summaries the values in the suppressed records will be included.

mlmcc

Author Commented:
Thanks to you both!  If {payCode} in [110, 115] Then 1 is basically saying if pay code is either 110 or 115.  What I need is if the employee group details contain BOTH pay codes 110 AND 115, then display, otherwise suppress.  Is that possible?

Commented:
Simply create 2 formulas one for paycode =110 and one for paycode =115.

Add the 2 summaries and test that both are > 0 on the group selection
Commented:
Simply create 2 formulas one for paycode =110 and one for paycode =115.

Add the 2 summaries and test that both are > 0 on the group selection

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Commented:
Add a section on the detail so that you have detail a and b. Have your detail a to be suppresses always. Do your test on detail a to see if paycode has both 110 and 115. If so then show detail b, if not suppress detail b. You could do thi svery well using a variables that you set it's value on detail a do your test and reset it on detail b after determinining whether to suppress or to show.

I hope this helps. If you need more explanation, let me know.
Commented:
The 110 and 115 are in separate records so on the first record in the group you won't know if both are in the group.  The summary method suggested by GJParker will work.

mlmcc
Commented:
if that's the case then yah, GJParker's suggestion will work
Author Commented:
Thanks a lot everyone.  GJParker's worked great!
Author Commented:
Thanks, you guys always come through!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.