Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Removing double records, math problem
Message
De
15/06/2007 12:04:19
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
15/06/2007 09:57:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01233421
Message ID:
01233526
Vues:
7
>Edward also made it clear to me that I am didn't describe that aspect clear enough. Rreading my text, I understand that.
>
>The resulting table should be a concatenation of the 4 tables, with all duplicates removed, but that should happen in an evenly distributed way, like the numerical examples displayed.

If a random pick with probabilities assigned in your proportion would do, then... something like this:

Let's say you have a set of four duplicates, one from each table, and the probabilities are 0.1, 0.2, 0.3, 0.4. Then just add them cumulatively, so the cumulative probability for the first one is 0.1, for 2nd 0.3, for 3rd 0.6 and 1.0 for the last. Then

locate for probability>rand() while key=lcKey

and use the record that you land on, and discard the others. This isn't perfect, and requires some legwork beforehand (got to fill those fields and got to total the probability, then divide it by total probability for each key), but I think it'd get you close to what you want.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform