Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count customer that only buy one product

HI. I have a listbox with items that customer have bought. How can I count how many people that have only bought the selected product in following example?And nothing else.

customer.     Item

a.                  Shirt

a.                  Shoes

b.                  Shoes

c.                   Shirt

d.                  gloves

d.                  Shoes 

e                   Gloves

expected result.

If I selected Shirt, number of customer = 1 (cust c)

select gloves, number of customer = 1 (cust e)

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

Chart : Straight Table

Dimension: Customer

Expression: Sum({<Item =P(Item)>} Aggr(If(Count({<Item =>}DISTINCT Item) = 1, 1, 0), customer))

Hope this helps you.

Regards,

Jagan.

View solution in original post

4 Replies
jduenyas
Specialist
Specialist

Try

Aggr(Count( Distinct customer), Item)

MK_QSL
MVP
MVP

=COUNT({<Item = P(Item)>}DISTINCT customer)

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

Chart : Straight Table

Dimension: Customer

Expression: Sum({<Item =P(Item)>} Aggr(If(Count({<Item =>}DISTINCT Item) = 1, 1, 0), customer))

Hope this helps you.

Regards,

Jagan.

anbu1984
Master III
Master III

=Count(DISTINCT {<customer=P(customer)>-<customer=P({<Item=E(Item)>})>}customer)