Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

cancel
Showing results for 
Search instead for 
Did you mean: 
ssha1983
Contributor II
Contributor II

Compare Customers by Products Purchased

Hi

I have 3 customers who purchase the below products

Customer Product Qty
A A1 40
A B1 20
B B1 40
B D1 10
C C1 25

 

Now I need to identify customers A and B who purchase overlapping products.(in this case B1)

Can anyone help to explain how do I do this please?

2 Replies
Taoufiq_Zarra

@ssha1983 

if i understood correctly you need products purchased by several customers at the same time

maye be like this :

=concat({<Product={"=count(Customer)>1"}>} distinct Product,',')

output:

 
 

Capture.PNG

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
Saravanan_Desingh

One more solution,

tab1:
LOAD * INLINE [
    Customer, Product, Qty
    A, A1, 40
    A, B1, 20
    B, B1, 40
    B, D1, 10
    C, C1, 25
];

Left Join(tab1)
LOAD Product, If(Count(Product)>1 And Count(DISTINCT Customer)>1,'Y') As Flag
Resident tab1
Group By Product;

commQV26.PNG