title: How can I count unique values corresponding to a break variable with the function aggregate in SPSS?
body: <p>I guess it is really easy, but I just cannot find the answer myself. The variable that I would like to calculate is the variable "Number_of brands_bought" (see below) and I've tried to use the aggregate function in SPSS with respondent as break variable and Brand as summaries of variables (and then I choose function count). However, it just does not give me the right answer. </p>
  
  <p>Respondent Brand Number_of_brands_bought
  1          1      3
  1          2      3
  1          3      3
  1          3      3
  2          1      2
  2          2      2
  3          1      3
  3          4      3
  3          5      3</p>
  
  <p>Does anybody know what to do? Thanks in advance!</p>