7 Replies Latest reply: Mar 2, 2012 8:11 AM by Stefan Wühl

# Set-Analysis comparing selections

I want to count how many customers who has bought each product. And this is not a problem for me. But when I want to count how many customers who has bought a combination of products then I have a problem. Is ther any possible solution.

If I would like to know how many customers who has a combination of product 02 and 04

Is it possible to have a presentation like this.

Product  Numbers of customer

02 not 04   1

02 and 04  2

04 not 02   1

[CustomerID, ProductID
1,03
1,02
2,04
3,05
3,03
4,03
5,02
5,04
6,04
6,06
6,02 ];

• ###### Set-Analysis comparing selections

I think you can re-use the crosstabulation solution I posted here for that, using the same dimension ProductID twice:

http://community.qlik.com/message/162179

Hope this helps,

Stefan

• ###### Re: Set-Analysis comparing selections

Thank you. It´s very userful when comparing two dimension. But I also want to have a third dimension. Like a venndiagram. Following combination.

Product Numbers of customers.

01 and 02 and 03

01 and 02

01 not 02 not 03

02 and 03

02 not 03 not 01

03 not 01 not 02

• ###### Re: Set-Analysis comparing selections

Hi,

check attached file for solution.

Regards,

jagan.

• ###### Re: Set-Analysis comparing selections

Hi,

Please check attached file for solution.

Hope it helps you.

Regards,

Jagan.

• ###### Re: Set-Analysis comparing selections

Thank you. What if I want to have a posibility to dynamic change ProductID. Is it possible to use som kind of variable?

• ###### Re: Set-Analysis comparing selections

Hi,

Try like this

Create variable vFieldName = ProductID

=Sum(Aggr(If(Count({<ProductID={'01', '02'}>} DISTINCT \$(vFieldName)) = 2, 1, 0), CustomerID))

Hope it helps you.

Regards,

Jagan.

• ###### Re: Set-Analysis comparing selections

Have you seen the tab "Sales Overlap" in the "What's new in QV11" demo? Maybe this could give you some ideas, too.