Need help - Using count distinct clause to eliminate repetitive data

Hey guys - you can have a look at this thread - using custom aggregation type to count distinct values: