Suppose you have a huge dataset with pupils and the classes that they attend. I want to create a filter where, when you filter on pupils, only the classes that they attend are shown. However, I also want to keep the other pupils who attend those indirectly filtered classes.
Example
Dataset:
| Pupil ID | Class ID |
|---|---|
| 1 | 1 |
| 1 | 2 |
| 2 | 1 |
| 3 | 1 |
| 3 | 4 |
| 4 | 4 |
| etc. | etc |
So when I filter on Pupil ID = 1, the output should be:
| Pupil ID | Class ID |
|---|---|
| 1 | 1 |
| 1 | 2 |
| 2 | 1 |
| 3 | 1 |
| etc. | etc |
My thought process so far is that each class is a group, and each group is overlapping. By choosing a Pupil ID, you indirectly choose a set of groups.
Does anyone have an idea as to how to avoid removing the non-selected pupils within the groups which are indirectly chosen by the selected (filtered) pupil?
Note: I have built the data model so that there are DIM_Pupil and DIM_Class tables.
