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!

Suppress duplicates within all previous records in a group 1

Status
Not open for further replies.

staciann

IS-IT--Management
Nov 1, 2006
72
US
Hi -

I am currently using the following formula to suppress "almost" duplicate records:

{PJPROJ.user1}=previous({PJPROJ.user1}) or
{PJPROJ.user1}="" or
right({PJPROJ.user1},5) like right(previous ({PJPROJ.user1}),5)or
left({PJPROJ.user1},5) like left(previous ({PJPROJ.user1}),5) or
mid({PJPROJ.user1},5) like mid(previous ({PJPROJ.user1}),5)

This works perfect if the two records are one right after another, however, this is often not the case.

For example, I may have:

ABC Company (Grouped by Company Name)
Dana Smith
Mr. Steve Jones
Mr. Vince Wright
Ms. Dana Smith
Nathan Martin
Steve Jones
Terry Armstrong

Is there a way that I can check the same left/middle/right character comparisons against the entire group instead of just by the one previous record?

I'd appreciate any insight.

Thank you,
Staci
 
First, it is much easier to group by name, suppress the detail lines and show the value in the group header or footer. Or if your data includes spaces, use whatever else it is that links them.

Your second problem is that you want to associate different name-texts that are the same name. You need to create a formula field that gets rid of Mr. etc. and keeps the rest. Something like
Code:
Replace({the.name}, "Mr. ", "")
This would produce identical results for Mr. Steve Jones
and Steve Jones, do the same for other prefixes. You can 'nest' replace statements, or call one formula field from another. Best to put the result field next to the data first, be sure it is right before grouping.

It helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods sometimes change between versions, and higher versions have extra options. In this case, it probably makes no difference.



[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Thank you so much Madawc! I never even thought to just remove the salutations from the records that had them in the name fields. Nesting the replace statements worked perfectly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top