×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# Suppress group if it contains both specified detail records

## Suppress group if it contains both specified detail records

(OP)
Hi

I have been struggling for several weeks on a report that I need to get finished, yet just can't get to work as it should. Essentially, I am trying to work out how to suppress a group based on the presence of BOTH specified values in the details section. Here is some example data, showing the groups of data as they are so far - grouped on Order No.:

Order = 45674567[Supplier = 180005 Product = WARDTREF123
Order = 45674567 Supplier = 180005 Product = CHEST12345

Order = 1234567 Supplier = 180005 Product = CHEST567809
Order = 1234567 Supplier = 0 Product = PREXMASPREF

Order = 3564896 Supplier = 0 Product = PREXMASPREF

Basically, I want to suppress the Order No. group in all cases except where there is a product by supplier 180005 AND supplier 0, but only where supplier 0's product code is PREXMASPREF. In the above item, that means that of the 3 example groups, only the middle one would still show.

I have tried all sorts of formulas to give 1 or 0 for each individual condition and then use them to create summaries, but I always end up with some anomolies.

Any helps gratefully appreciated!

Many thanks

Petejigsaw

### RE: Suppress group if it contains both specified detail records

Create two formulas:

//{@supplier108005}:
If supplier = 180005 then 1

//{@supplier0prex}:
If supplier=0 and
Product code=PREXMASPREF then 1

Then use a group selection formula. Go to report->selection formula->GROUP and enter:

Sum({@supplier108005},table.orderno})>=1 and
sum({@supplier0prex},{table.orderno})>=1

If you continue to have anomalies, show examples of those anomalies.

-LB

### RE: Suppress group if it contains both specified detail records

(OP)
Thanks lbass - that works a treat! I was on the right lines, but was trying to do it via group supression, rather than as group selection.

### RE: Suppress group if it contains both specified detail records

I think you could have used group suppression as follows:

Sum({@supplier108005},table.orderno})=0 OR //note the change from AND to OR
sum({@supplier0prex},{table.orderno})=0

-LB

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Close Box

# Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!