Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Finding Duplicates Post Reply Post New Topic
Author Message
jjschuly
Newbie
Newbie
Avatar

Joined: 24 Nov 2008
Location: United States
Online Status: Offline
Posts: 2
Quote jjschuly Replybullet Topic: Finding Duplicates
     Posted: 24 Nov 2008 at 1:58pm
I am new to Crystal Reports and I am wondering if you can find and display duplicate numbers in a field? 
I have orders with trace numbers that I want to find all orders with the same trace number.  This should eliminate duplicate orders I would hope.
 
Your help would be appreciated.
 
 
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 25 Nov 2008 at 6:32am
if the trace number is just one field, as opposed to a group of them, and the number that it is tracing is unique...I would create a group on the trace number field, then you could display all orders with that trace value.
 
Hope this helps
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 25 Nov 2008 at 10:47am
And if you want to just show the ones that are duplicates, suppress the section and the put something like the following in the supression formula for the section where you're displaying the data:
 
{table.trace_number} = next({table.trace_number}) or {table.trace_number} = previous({table.trace_number})
 
That will suppress the section except when the trace number is the same as either the previous or the next record.
 
-Dell
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 25 Nov 2008 at 11:14am

Shouldn't the equal signs be not equal? 

If an expression evaluates to true it will be suppressed.
 
So if the trace number are the same, they will be suppressed and the non duplicated entries will be displayed.
 
Just double checking.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 25 Nov 2008 at 11:51am
If you check the suppress box and then enter the formula, items will be suppressed EXCEPT when they meet the criteria.
 
-Dell
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 25 Nov 2008 at 11:53am

Thanks, didn't know that, I have only used them independently, either use the suppression formula OR suppress the line in total.

Will have to remember for the future :)
IP IP Logged
jjschuly
Newbie
Newbie
Avatar

Joined: 24 Nov 2008
Location: United States
Online Status: Offline
Posts: 2
Quote jjschuly Replybullet Posted: 25 Nov 2008 at 2:18pm

I tried this formula, but what I want is to find duplicates in the database.  Does that work with this formula?

IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 25 Nov 2008 at 2:21pm

The formula is about suppressing items that are NOT duplicates.  Do what lockwelle said - group by tracking number.  That will group everything with the same tracking number together.  Then suppress the section containing the data using the formula so that the tracking numbers that don't have multiple records don't show up on your report.

-Dell

IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum