I have a table where I am trying to count the number of distinct Child IDs are within a parent dimension. Each Child ID has to be counted once within each Parent ID, but can be counted again if it appears inside another Parent ID. Each parent has to be distinct, and each child has to be distinct within the parent ID.
This is a small sample of the data. The correct answer for Child IDs would be 17, not 22. Parent IDs often appear many times within the larger data-set.