I have the following Mock table:
+---------+-------------------+------+------+
| NAME | TITLE | SIZE | Hit |
+---------+-------------------+------+------+
| A | Hippo1 | H | 0 |
| A | Hippo2 | H | 0 |
| A | Hippo3 | H | 1 |
| A | Hippo1 | M | 0 |
| A | Hippo2 | M | 1 |
| A | Hippo3 | M | 1 |
| A | Hippo1 | L | 0 |
| A | Hippo2 | L | 1 |
| A | Hippo3 | L | 1 |
+---------+-------------------+------+------+
| B | Snail1 | H | 1 |
| B | Snail1 | M | 0 |
| B | Snail1 | L | 1 |
+---------+-------------------+------+------+
| C | Dog | H | 1 |
| C | Dog | M | 0 |
+---------+-------------------+------+------+
| D | Sheep | H | 0 |
| D | Sheep | L | 1 |
+---------+-------------------+------+------+
| E | Fish | H | 1 |
| E | Fish | H | 1 |
+---------+-------------------+------+------+
My Desired Result would
+---------+----------+-------+
| NAME | TITLE | SCORE |
+---------+----------+-------+
| A | Hippo | 100 |
| B | Snail | 80 |
| C | Dog | 80 |
| D | Sheep | 10 |
| E | Fish | 100 |
+---------+----------+-------+
Computations required:
- Type can have only three values at most: {H, M, L};
- When all values are present, they are graded as followed: H=70 M=20 L=10
-
ALL unique casese are
- Case {H,M} : H=80 M=20
- Case {M,L} : M=60 L=40
- Case {H,L} : H=90 L=10
- Case {H} : H=100
- Case {M} : M=100
- Case {L} : L=100
- Case {H,M,L} : H=70 M=20 L=10
Explanation:
Hippo Has case {H,M,L}
Snail has case {H,M,L}
Dog has case {H,M}
Sheep has case {H,L}
Fish has case {H}
Further Explanation
Hippo : Athough not all sizes have a hit, Hippo has gained the score 100 because atleast 1 of each case has been satified once per title. Hence HIPPO3 has all three H M
L satsified so hippo can be conidered found 100 percent
Extracted from above (lines are logical construct for viewer)
| A | Hippo1 | H | 0 |
| A | Hippo2 | H | 0 |
| A | Hippo3 | H | 1 | <--Here
+-------------------------------------------+
| A | Hippo1 | M | 0 |
| A | Hippo2 | M | 1 |
| A | Hippo3 | M | 1 | <--Here
+-------------------------------------------+
| A | Hippo1 | L | 0 |
| A | Hippo2 | L | 1 |
| A | Hippo3 | L | 1 | <--Here
Here you go:
It is not clear how to get the Title given your data (actually the result has data it is not present in the original tables, such as
Hippo, instead ofHippo1. But I’ll leave that to you.This will result in: