| Author |
Message |
jjschuly
Newbie
Joined: 24 Nov 2008
Location: United States
Online Status: Offline
Posts: 2
|

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 Logged |
|
|
|
lockwelle
Moderator
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
|

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 Logged |
|
hilfy
Admin Group
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
|

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 Logged |
|
lockwelle
Moderator
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
|

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 Logged |
|
hilfy
Admin Group
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
|

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 Logged |
|
lockwelle
Moderator
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
|

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 Logged |
|
jjschuly
Newbie
Joined: 24 Nov 2008
Location: United States
Online Status: Offline
Posts: 2
|

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 Logged |
|
hilfy
Admin Group
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
|

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 Logged |
|
|
|