Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Removing double records, math problem
Message
From
15/06/2007 12:04:19
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
To
15/06/2007 09:57:51
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01233421
Message ID:
01233526
Views:
8
>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform