I have a dataset that is representative of a general population, and am trying to do weighted counts of the individuals based on some filters.
For example, my dataset would look something like this:
ID WEIGHT SEX REGION HOBBY
2 2300 M NE Basketball
2 2300 M NE Darts
3 1200 M SW Basketball
3 1200 M SW Football
4 2400 F NE Cycling
4 2400 F NE Darts
To get a weighted total of Males, I would add only the weight for each distinct ID where the SEX=M (2300 + 1200 = 3500).
Similarly, to get a weighted total of all those who like darts, I would add only the weight for each distinct ID where HOBBY = "Darts" (2300+2400 = 4700).
In OAC, I only see a COUNT(DISTINCT) option or a SUM(DISTINCT), but those do a distinct on the same column (ie: weight). I can have several different IDs with the same weight, but need to add the weight together for each distinct ID.
How would I do this?