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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Eliminate both records in a group

Status
Not open for further replies.

sap1958

Technical User
Oct 22, 2009
138
US
Here is a group I have in crystal 2008
GroupHeader ID
ID NAME DEPT SECONDARYDEPT
1 John Smith ENGINEERING 14
1 John Smith ENGINEERING 15
----------------I want to eliminate both-----------------
2 Sam Brown ENGINEERING 15
3 Louise Brown ENGINEERING 15
5 Phil Jones ENGINEERING 14

In this scenario, I want to eliminate both records of John Smith because he has 14 in the SECONDARYDEPT column, not just the number 14 entry. I also want to eliminate Phil Jones because he has one instance of SECONDARYDEPT column 14. The issue is crystal evaluates records individually on each line. How can I eliminate multiple records of the same ID based on the existence of one unwanted item?
 
Insert a group on ID, and then create a formula {@has14}:

if {table.secondarydept} = 14 then 1

Then go to report->selection formula->GROUP and enter:

sum({@has14},{table.ID}) = 0

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top