Get the associations between the fields of two tables
Get the associations for each pair of fields between two tables by using the GetAssociationScores method.
Example
The app used in this example contains two tables TableA and TableB. There are no synthetic keys in the tables.
TableA contains two fields FieldA-1 and FieldA-2.
FieldA-1 | FieldA-2 |
---|---|
1 | a |
2 | a |
3 | b |
4 | c |
5 | d |
6 | e |
7 | c |
TableB contains two fields FieldB-1 and FieldB-2.
FieldB-1 | FieldB-2 |
---|---|
1 | g |
1 | h |
12 | i |
3 | i |
4 | k |
10 | l |
Compute the association scores for each pair of fields in the tables TableA and TableB by using the GetAssociationScores method.
The client sends:
The engine returns:
The association scores are returned.
For the pair FieldA-1 / FieldB-1 and the field FieldA-1, the following results are returned:
- qCardinalRatio is 1 because all values are unique in the field FieldA-1.
- qSymbolScore is 0.42857142857142855 because there are 3 distinct values in the field FieldA-1 that match the values in the field FieldB-1 and the number of distinct values in the field FieldA-1 is 7.
- qRowScore is 0.42857142857142855 because there are 3 values in the field FieldA-1 that match the values in the field FieldB-1 and the number of values in the field FieldA-1 is 7.
For the pair FieldA-1 / FieldB-1 and the field FieldB-1, the following results are returned:
- qCardinalRatio is 0.83333333333333337 because there are 5 values over 6 that are unique in the field FieldB-1.
- qSymbolScore is 0.6 because there are 3 distinct values in the field FieldB-1 that match the values in the field FieldA-1 and the number of distinct values in the field FieldB-1 is 5.
- qRowScore is 0.66666666666666663 because there are 4 values in the field FieldB-1 that match the values in the field FieldA-1 and the number of values in the field FieldB-1 is 6.
For the pair FieldA-1 / FieldB-2 and the field FieldA-1, the following results are returned:
- qScoreSummary is -1 because the fields FieldA-1 and FieldB-2 are different types. Therefore, all other fields (cardinal ratio, symbol score, row score) are all zero, which means that they were not computed.