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

0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
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?

0
 
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
0
 
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.
0
 
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
0
 
HlanaiCommented:
if that's the case then yah, GJParker's suggestion will work
0
 
jph826Author Commented:
Thanks a lot everyone.  GJParker's worked great!
0
 
jph826Author Commented:
Thanks, you guys always come through!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.