I am having trouble writing a code for this, say I have the following data:

product type

a 1

a 2

a 3

b 1

c 1

c 2

d 3

e 1

e 2

e 3

I want to make 3 data sets, 1st one only has products which has all 3 type (1, 2, 3) so that dataset will have product a and e.

2nd dataset is just products with 2 types (1 and 2) so it will have product c in it.

then last data set just has product with 1 type (product b and d)

or is there a way to add a column which gives each product row a value say z if it has 3 types and x if it has 2 types.

either way it will help me very much.

My data is very large over 55,000 rows.

Thanks !!!!