Hi guys - I'm needing some help with a query, and I've reached the 'no ideas anymore' stage!
I'm performing a kind of 'fuzzy' match in order to find the most similar record in one table to a record in another table.
There are several fields to be compared, and some of them are deemed more important to match than others, so I have another wee small table containing weighting scores.
Some of the matching fields are text, and these have to match exactly or not at all, so these are easy (if are = then 1 * weighting score, else 0), and the rest are numeric fields and I'm just trying to find the closest.
Because I need to allow for the weighting score, I was aiming to divide the smallest number by the biggest, then if they match I'll get 1, and if not I'll get a fraction which is smaller than 1; this can then be multiplied by the weighting score again.
So far so good! I've built a 'model' of this is Excel so I can see if working and in general I'm really happy.
It has thrown up an issue that I hadn't thought of though...
Some of the numbers to be matched may well be zero.
This is perfectly valid, but doesn't help if I'm trying to get close to a 1 by dividing one by the other.
So, any ideas about how I calculate how close a number is, ending up with a maximum of 1, if one of them can be zero??
Thanks in advance for any suggestions at all.
Fi.
"The question should be, is it worth trying to do, not can it be done"
I'm performing a kind of 'fuzzy' match in order to find the most similar record in one table to a record in another table.
There are several fields to be compared, and some of them are deemed more important to match than others, so I have another wee small table containing weighting scores.
Some of the matching fields are text, and these have to match exactly or not at all, so these are easy (if are = then 1 * weighting score, else 0), and the rest are numeric fields and I'm just trying to find the closest.
Because I need to allow for the weighting score, I was aiming to divide the smallest number by the biggest, then if they match I'll get 1, and if not I'll get a fraction which is smaller than 1; this can then be multiplied by the weighting score again.
So far so good! I've built a 'model' of this is Excel so I can see if working and in general I'm really happy.
It has thrown up an issue that I hadn't thought of though...
Some of the numbers to be matched may well be zero.
This is perfectly valid, but doesn't help if I'm trying to get close to a 1 by dividing one by the other.
So, any ideas about how I calculate how close a number is, ending up with a maximum of 1, if one of them can be zero??
Thanks in advance for any suggestions at all.
Fi.
"The question should be, is it worth trying to do, not can it be done"