Solved

Search for duplicates

Posted on 2006-11-15
8
218 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
 
LVL 19

Assisted Solution

by:madheeswar
madheeswar earned 50 total points
ID: 17956175
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
LOtus Notes 6.5 low performance 13 31
Lotus Notes 41 163
Domino Server 11 62
Migrating from Lotus Notes to Office 365 2 121
This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now