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!

Supress Duplicate Records

Status
Not open for further replies.

terenceb

Programmer
Jun 10, 2003
77
US
Hi,

I am running Crystal 8.5 on win Xp workstation connecting to a Cashe datadase.

I need to supress duplicate records. I am grouping my report on Client ID and then on Target POP. My data looks like this:

Client ID 7345
Target pop Service data
DSMJO 59840.1
DSMJO 59840.2
AMSHO 59840.1
AMSHO 59840.2
CNDSJ 59859.1
CNDSJ 59862.1
I need to supress the duplicate data and display the data that is unique. If the Target Pop is different and the Service data is the same then it should be supressed. Also if the Target Pop is different and the Service data is different then data should be displayed. There is no limit to the number of Target Pops a client can be enrolled in.
 
Unless there are other fields that are unique, you should be able to screen out the duplicate records by Clicking on Database -> Select Distinct Records
 
Thanks,

I have tried that and it does not work.
 
right-click on the {Target pop} Field

select [Format Field..]
select [Common] tab

add this formula to Suppress option

IF PREVIOUS({Target pop})= {Target pop} THEN
TRUE
ELSE
FALSE
 
I should have looked closer at your report. What is in each section? Not know the other detail objects you are displaying but you could do one of the following

PH (Page Header)
Target pop Service data
GH 1 (Group Header 1)
Client ID 7345
D (Detail)
DSMJO 59840.1
DSMJO 59840.2
AMSHO 59840.1
AMSHO 59840.2
CNDSJ 59859.1
CNDSJ 59862.1
GF (Group Footer)
RF (Report Footer)
PF (Page Footer)

If this is your set up and you just want to get rid of the duplicates on the details, then right click on target Pop field object -> format field and under the common tab, click on suppress duplicate records

OR

Create another group on Target Pop. Format the GH 2 to underlay following section and it will basically look like the one above.

PH (Page Header)
Target pop Service data
GH 1 (Group Header 1)
Client ID 7345
GH 2 (underlay following section)
DSMJO
D (Detail)
59840.1
59840.2
GF 2 (suppressed)
GH 2
AMSHO
D (Detail)
59840.1
59840.2
GF 2
GH 2
CNDSJ
D (Detail)
59859.1
59862.1
GF (Group Footer)
RF (Report Footer)
PF (Page Footer)
 
Maybe I did not make what I am looking for clear. I want to do any with the whole record not just the Target POP. If I can get my report to run correctly it should look like :
Client ID 7345
Target pop Service data
DSMJO 59840.1
DSMJO 59840.2
CNDSJ 59859.1
CNDSJ 59862.1

Instead of:
Client ID 7345
Target pop Service data
DSMJO 59840.1
DSMJO 59840.2
AMSHO 59840.1
AMSHO 59840.2
CNDSJ 59859.1
CNDSJ 59862.1

 
Client ID 7345
Target pop Service data
DSMJO 59840.1
59840.2
CNDSJ 59859.1
59862.1

Instead of:
Client ID 7345
Target pop Service data
DSMJO 59840.1
59840.2
AMSHO 59840.1
59840.2
CNDSJ 59859.1
59862.1

have to give a resultat like this
 
I think you would need to create formulas like the following:

//{@reset} to be placed in the client group header:
whileprintingrecords;
stringvar x := "";

//{@accum} to be placed in the details section:
whileprintingrecords;
stringvar x;

if instr(x,{table.servicedata}) = 0 then
x := x + {table.servicedata};

Then go to the section expert->details->suppress->x+2 and enter:

{@accum} = ""

-LB
 
HI LBASS,

My Service data field is a Horolog date field or julian date. This gives the appointment date for my clients and if the Target Pops are different and Service data is the same then one of the entire records are incorrect. I don't think I can add on it. And I am not quite
 
You could still use the above formulas by changing the formula to:

whileprintingrecords;
stringvar x;

if instr(x,totext({table.servicedata},1,"")) = 0 then
x := x + totext({table.servicedata},1,"")+", ";

It looked to me like you were getting duplicate data for groups, and therefore I thought that the above would work, even if it is looking at matches at the detail level, not the group level. You might try this and then report back.

-LB
 
Hi,

I am stepping away from this for a while to refocus my eyes;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top