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
jph826Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

GJParkerCommented:
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
mlmccCommented:
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

jph826Author 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?

CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

GJParkerCommented:
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
GJParkerCommented:
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

Your issues matter to us.

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

Start your 7-day free trial
HlanaiCommented:
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.
mlmccCommented:
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
HlanaiCommented:
if that's the case then yah, GJParker's suggestion will work
jph826Author Commented:
Thanks a lot everyone.  GJParker's worked great!
jph826Author 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.