Solved

Search for duplicates

Posted on 2006-11-15
8
221 Views
Last Modified: 2013-12-18
Hi All,

I need your help once again. I have a view called duplicates and I need to write code that bring duplicates for a field called ApplicationNumber.

For Example

ApplicationNumber      First Name      Last Name
1111                  Paul            Janes
222                  Mary            Smith
111                  Peter            Cater

The view will show the following:

ApplicationNumber      First Name      Last Name
1111                  Paul            Janes
111                  Peter            Cater

Could any one help with this problem?  

Thanks in advance.
0
Comment
Question by:jose11au
  • 2
  • 2
  • 2
  • +2
8 Comments
 
LVL 18

Expert Comment

by:marilyng
ID: 17952009
Not quite understanding.  Neither view is showing a duplicate.. what makes 222 a duplicate?
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 17953887
yes....it is not at all lighting my mind.

Please tell in detail...
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 17956014
Or did you mean 1111 in the two last cases? And you want that in a view? (I may get shot, but I'm going to say it again:) I think that's not possible.

If you want to remove duplicates, you will need some code to do that.
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
LVL 19

Assisted Solution

by:madheeswar
madheeswar earned 50 total points
ID: 17956175
0
 
LVL 8

Expert Comment

by:behenderson
ID: 17959497
Put an @Text around the application number field in the column formula  @Text(ApplicationNumber) will order by first alphanumeric not by number
0
 
LVL 18

Assisted Solution

by:marilyng
marilyng earned 50 total points
ID: 17961537
Agreed, you not only need code, but you need a field that concatenates all values that might (together) indicate a duplicate.

for example:
1111*maryjones*dept1234*20061101
1111*maryjones*dept1234*20051105

Then you need to decide which record is the right one to keep - if you concatenate and sort ascending, categorized, then you will see which category has more than one entry, and which is the latest.

So a view navigator will locate the first category, and then tell you how many children are in the collection, skip the first, delete the rest.

maddy's links are helpful for base code to use.
0
 
LVL 8

Accepted Solution

by:
behenderson earned 400 total points
ID: 17962830
SOmething like the agent below will work.. I typed it out freehand so check it and test it first... But something like this should work

This agent marks both the first and second documents with the IsDuplicat flag.. you then create a view that includes only items with this flag and determine which doc you want to delete.

Dim db as NotesDatabase
dim vwApplicationNumbers as NotesView
dim doc as NotesDocument
dim docNext as NotesDocument
dim docWayNext as NotesDocument
dim strAppNum as String
dim strAppNumNext as String
set db = new NotesDatabase
set vwApplicationNumbers = db.getView( "Name of View" )
set doc = vwApplicationNumbers.GetFirstDocument
Do WHile Not doc is nothing
  docNext = vwApplicationNumbers.GetNextDocument( doc )
  If docNext is nothing then exit Do
  strAppNum = doc.ApplicationNumber(0)
  strAppNumNext = docNext.ApplicationNumber(0)
  Do while strAppNum = strAppNumNext
    doc.IsDuplicate = "1"
    docWayNext = vwApplicationNumbers.GetNextDocument( docNext )
    docNext.IsDuplicate = "1"
    call doc.save( true, true )
    call docNext.Save( true, true )
    If docWayNext is nothing then exit Sub
    set docnext = docWayNext
    strAppNumNext = docNext.ApplicationNumber(0)
  Loop
  Set doc = docNext
Loop
0
 

Author Comment

by:jose11au
ID: 17992137
Hi Guys,

Thanks for the help. My apologies for the delay in repying, been away from the office.

Regards,
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question