Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Adamo
Contributor III
Contributor III

Both conditions meet in Set analysis in same variable

Hi,

I need to count Clients that had bought alt least 2 products in the same month.

Sample Data.

Client_id       Product       Sale      Month

1                        1                   1                1

1                       2                   1                1

2                      1                     1                1

2                      2                      1               2

3                     2                      1                1          

In the case above  only client 1 should be counted as is the only one that bought Product 1 and 2 in the same month. I was thinking of using P function, but the problem is that P function operates in the whole dataset, and need a function tha can working alongwith Month Dimension.

 

This function is not what I Expect, because Client 2 will also be counted in Month2

Count({<Client_id=
P({<Product ={"1"}>})
*P({<Product ={"2"}>})>}distinct Client_id )

 

Any help??

 

Labels (2)
1 Reply
jochem_zw
Partner Ambassador
Partner Ambassador

Create Table with Client and month as dimension 

and

=if(count(Distinct Product)>1,count(Distinct Product))

as expression