Fixing lead table with duplicate leads

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

Fixing lead table with duplicate leads

Postby jwhawkins » Tue Apr 17, 2007 3:07 am

OK... I've explained to my client the importance of using the duplicate check feature of the list loader, but inevitably, they failed to use it...

So, the question is, is there a /simple/ method to deobfuscate this situation? There are duplicate leads in the lead list - however, the complicating factor is that all the duplicate leads have different lead_id's (I assume this is used as the primary key on the table).

At the point at which it was brought up to me, there are currently 54,000+ leads in the table, a large chunk of which are duplicates. I've tried using a variety of methods to fix this, including:

SELECT DISTINCT (and various permutations thereof) SQL statements
sed/awk scripting (the major result of which was the intake of mass quantities of alcohol)
grep & regexing (see item #2 for result)

This situation has me utterly perplexed, and I'm afraid that my PHP ability falls far short of being able to fix this issue. My coding ability, as a whole, falls short of doing this outside of COBOL.

Any ideas, anyone ?
=-=-=-=-=-=-=-=-

Jacob W. Hawkins
Midwest Technology Industries
jwhawkins
 
Posts: 11
Joined: Fri Mar 23, 2007 6:01 am
Location: Terre Haute, IN

Fixing lead table with duplicate leads

Postby xirin6 » Tue Apr 17, 2007 9:09 am

Hello my name is Kevin I work with Matt F. My question is have these leads in this list been dialed on yet?

Kevin Kelley
xirin6
 
Posts: 22
Joined: Wed Jun 07, 2006 3:24 pm
Location: Florida

Postby henry » Tue Apr 17, 2007 12:14 pm

I have experienced this problem many times before (sometimes I've screwed the data up, and sometimes other people!) and the best way to fix it is with a simple script customised to suit your situation.

Basically you can use a query like this to find the duplicates:

SELECT phone_number, COUNT(*) AS num FROM vicidial_list GROUP BY phone_number HAVING num>1

You can then iterate over the result set in your PHP script (or anything else that you can connect to the database with) and delete one of the records. Usually I would delete the record which has not been called yet or has already been closed with a sale or not interested etc.

An alternative to deleting the record is to flag is as something else so that it is not called by changing the status or some other field for a different database structure.
henry
 
Posts: 18
Joined: Mon Mar 12, 2007 5:08 am

More on the leads

Postby jwhawkins » Tue Apr 17, 2007 12:55 pm

Some have been called, some have not. I will try that query and see if it gives me any results :)

-- Jake Hawkins
=-=-=-=-=-=-=-=-

Jacob W. Hawkins
Midwest Technology Industries
jwhawkins
 
Posts: 11
Joined: Fri Mar 23, 2007 6:01 am
Location: Terre Haute, IN


Return to Support

Who is online

Users browsing this forum: No registered users and 89 guests