Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
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)

Labels (1)
1 Solution

Accepted Solutions
jagan
Partner - Champion III
Partner - Champion III

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
Partner - Champion III
Partner - Champion III

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)