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

Trash records in previous/next report 1

Status
Not open for further replies.

vblack7770

Programmer
Apr 11, 2005
26
US
I am a somewhat seasone Crystal report writer. I am currently using 8.5 with and ODBC connection to and Oracle DB.
I have written a report using the WilePrintingRecords formula set to compare my prev and my next records. The purpose of the report is find where we have duplicate records for one borrower, property, loan amount, etc. So have two sets of formulas for each records. One set compares current to previous and one set compares current to next. What I am finding is that I get a trash record at the beginning and a trash record at the end. I can place a count on the records and suppress the first trash record, but I have no idea how to suppress the last trash record on the report.

 
You shouldn't need to use previous and next for this. If you are looking for records with the same field, e.g., {table.borrower}, then insert a group on {table.borrower}, and then go to report->edit selection formula->GROUP and enter:

count({table.borrower},{table.borrower}) > 1

This will return all records for any groups that have more than one record. If you need them to match on multiple fields, then concatenate the fields and use the formula in the group selection as above.

If once you have identified the duplicate records you only want to display one instance of it, suppress the detail records, so that the group header only displays.

-LB

 
They may be considered duplicate because only some of the files match, not all. There are several combinations. Example:
Test 1 - borrower name, property and lien position match
or
Test 2 - borrower name, property and loan amount match
or
Test 3 - property, lien position match
etc.,

So, I can't group by just one item.
 
Then I guess you should use the previous function, but you don't need to use both previous and next. First create these formulas:

//{@concat1}:
{table.borrowername}+{table.property}+{table.lienposition}

//{@concat2}:
{table.borrowername}+{table.property}+{table.loanamount}

//{@concat3}:
{table.property}+{lienposition}

Then create a fourth formula {@alldupes}:

if {@concat1} = previous({@concat1}) or
{@concat2} = previous({@concat2}) or
{@concat3} = previous({@concat3}) then "Dupe" else ""

You could then go to the section expert->details->suppress and enter:

{@alldupes} = ""

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top