I am basically trying to group by 2 variables and perform a proc sql mean, however my group by won't work for the following reason : here's an example of what I am trying to get (Assuming the data here is sorted properly)
Now I know that this is not how the mean functions work so I've tried thinking about ways to resolve my issue and I've found that this would work :
However I don't know how I could obtain that. I have tried
data want;
set have;
count + 1;
by User Var X;
if first.User then count = 1;
run;
However this does not seem to get the trick done. Any ideas on how to resolve this ?
Thanks for reading !


Like this?