Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Supress all records if one flags

Status
Not open for further replies.

cwhite53

Programmer
Jun 15, 2011
2
GB
I have a database with data such as:

Ref Flag Data
500 0 Data1
500 1 Data1
500 0 Data1
501 0 Data2
501 0 Data2
501 0 Data2
502 1 Data3
502 0 Data3
503 0 Data4
503 0 Data4

I am using Crystal Reports 11 to produce a summary list of certain aspects of this data. I want a list that includes one line for every record but excludes that record if the flag for any line with that record is 1. So only records where all of the flags are 0. With the above the result should be:

Ref Flag Data
501 0 Data2
503 0 Data4

If you understand my explanation then any help would be appreciated.

Thank you



 
Group Report by Ref

In Group Selection

Maximum(Flag, Ref) =0

This will suppress data but it will still be there, thus if you use summaries they will be included. You will need to use Running Total which exclude the suppressed data.

In evaluate for RT use

Maximum(Flag, Ref) =0

Ian
 
Ian

You genius, grouping never even occurred to me. A perfect solution.

Thank you

 
A point of clarification:

You can use running totals without an evaluation formula when used with group selection and they will be accurate. It is section suppression that requires an evaluation formula in a running total that explicitly removes unwanted records from the calculation. This difference inh the behavior of running totals is why group selection is sometimes a better option than section suppression.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top