Need help - Using count distinct clause to eliminate repetitive data

I have tried this and commented in the post Program indicator for count of unique/distinct values - #17 by Matthew_Boddie (as have others) on this not being functional. Though perhaps we are doing something incorrect?