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

Formula to search column and if fields match delete one

Status
Not open for further replies.
Nov 7, 2005
103
US
Hello, I am using crystal 8.5 reading from a ProISAM (ProIV) database. What I am tying to do is read the field "SerialNumber" and if there is a match look at field "InspectionType". For the matching serial numbers if "InspectionType" = "YI" and "PI" then delete all data in row that = "PI".

Example Data:

CURRENT RESULT:

Contract# Serial# Inspection Type

48999 323232 YI
48505 323232 PI
48515 323232 PI

DESIRED RESULT:

Contract# Serial# Inspection Type
48999 323232 YI
 
What result would you want if there were no type "YI"? Are "YI" types always the highest contract #?

-LB
 
Crystal does not typiclly delete data, it reports on it. You can conditionally suppress a field so as not to report on it, or write a record selection formula to skip the record entirely, if you want your report to exclude fields or records. Is this what you want?

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
reply to lbass:

ideally if there was no "YI" then I would like to check if there are more than one "PI" and only print one "PI" otherwise if there were no "YI" then do nothing

reply to dgillz:

yes I would like it to skip or exclude the fields, I tried the suppress option but it only suppresses the field not the entire row. If i could suppress the entire row that would be good
 
I think you could just group on serial number, sort the records by Inspection Type, descending, and then either place all fields in the group header. Or if you want to suppress the records, you could go to format->section->details->suppress->x+2 and enter:

{table.serialnumber} <> previous({table.serialnumber})

This would return the first record per group, and because of the sorting, if there is a record with "YI" that would appear, otherwise "PI" would.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top