G
Guest
I am designing a database with a rather simple flat structure to hold a set
of measurement data. There are ten input fields named A-J plus one field to
hold a description. The idea with the database is to first match a new set of
A-J with all old A-J, and then to get the description from the old A-J set
that was the best match.
This matching must be done according to some mathematical formula. The
formula might change during the development while I am experimenting to see
whech gives the best result. My first assumptions are two:
1. Let's call the new A-J An-Jn and the old ones Ao-Jo. The simple formula
then is Sum = |An-Ao| + |Bn-Bo| + |Cn-Co|... + |Jn-Jo| (|number| is the
absolute value of a number. The absolute value of |62-64| = 2, i.e. you
perform the subtraction and then remove any negative sign).
The matching is to find te smallest Sum, and to sort the entries according
to Sum in ascending order, with the smallest Sum first.
2. This is slightly more complicated, but not much. Sum = (An-Ao)^2 +
(Bn-Bo)^2 + (Cn-Co)^2 ... + (Jn-Jo)^2 (^2 means squared).
How can this be done?
Best,
Tomas
of measurement data. There are ten input fields named A-J plus one field to
hold a description. The idea with the database is to first match a new set of
A-J with all old A-J, and then to get the description from the old A-J set
that was the best match.
This matching must be done according to some mathematical formula. The
formula might change during the development while I am experimenting to see
whech gives the best result. My first assumptions are two:
1. Let's call the new A-J An-Jn and the old ones Ao-Jo. The simple formula
then is Sum = |An-Ao| + |Bn-Bo| + |Cn-Co|... + |Jn-Jo| (|number| is the
absolute value of a number. The absolute value of |62-64| = 2, i.e. you
perform the subtraction and then remove any negative sign).
The matching is to find te smallest Sum, and to sort the entries according
to Sum in ascending order, with the smallest Sum first.
2. This is slightly more complicated, but not much. Sum = (An-Ao)^2 +
(Bn-Bo)^2 + (Cn-Co)^2 ... + (Jn-Jo)^2 (^2 means squared).
How can this be done?
Best,
Tomas