Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Search for duplicates

Posted on 2006-11-15
8
222 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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to add a username for multiple users in Lotus 6 116
Lotus notes email code 6 116
Migrating from Lotus Notes to Office 365 2 148
DIIOP IP Addresses Changes Automatically 5 92
You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

789 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