3 Replies Latest reply: Mar 28, 2011 4:22 AM by Miguel Angel Baeyens de Arce

# How to get the nums?

Hi All,

I have the following table.

[
CountMemberId,Category
1,A
1,A
2,C
2,A
3,A

]

I want to use an expression to show how many members have bought at leaset 2 products whose category is A.

For this test, only one whose ID is 1.

How to finish it?

• ###### How to get the nums?

Hello Isaac,

I'd use something like

`Count({< CountMemberId = {"=Count({< Category = {'A'} >} CountMemberId) > 1"} >} DISTINCT CountMemberId)`

Hope that helps.

• ###### How to get the nums?

Yes, it works, you are always my teacher.

Now I have an additional question on it.

If I want to get the nums who bought at least 2 product A or at least 1 product C, how to use set analysis, in this case, 1 have bought 2 A and 2 have bought 1 C, so the result is two, how to finish it?

Thanks Miguel Angel Baeyens.

• ###### How to get the nums?

Hello,

Use

`Count({< CountMemberId = {"=Count({< Category = {'A'} > + < Category = {'C'} >} CountMemberId) > 1"} >} DISTINCT CountMemberId)`

That will return "1" for those CountMemberId who have bought either 2 "A" or 2 "C".

Hope that helps.