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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Counting Customers who ordered Multiple Products

I am trying to figure out how to create a bar chart that will count which customers have purchased multiple products.  I need this to be on the front end through the use of an expression. 

I already created one chart that will count how many customers have purchased a single product.

the expression I used for this was:

Count({$<Status = {'Invoices'}, Amount = {">0"}>}DISTINCT([Ship To Customer Account Name]))

I hope I have given enough information.

Thanks,

Chris

1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

I would do an expression search (The Expression Search) inside the Set Analysis:

Count({$<Customer={"=Count(distinct Product)>1"}>} distinct Customer )

HIC

View solution in original post

9 Replies
Not applicable
Author

what happens if you sue the same expression and remove 'Distinct' - that will show everything - customers that have 1 and customers that have more than 1

you can alsways subtract your 2 expressions - the one you ahve will give you the ones that have just 1 product and the other (which takes yours and the one without distinct) would give you the ones that have more than 1

Anonymous
Not applicable
Author

The customer could still have multiple orders of the same product.  I used the distinct to remove that possibility.  I may be wrong in my logic, but I thought that is what I was doing.

Not applicable
Author

it looks like the expression is looking at invoices, not products to distinct customers, so I believe you would get all invoices to distinct customers, not necessarily products to distince customers - each invoce has multiple items (products I would think).

any way for you to send a qvw?

Anonymous
Not applicable
Author

Here is a quick QVW that you should be able to use.

Thanks,

Not applicable
Author

if I understand, customers A,D each have 1 product, B,C have 2 products?

it looks like this does not ahve the same fiels (status for example), but if my understanding above is correct, should not be an issue

Anonymous
Not applicable
Author

You are correct customers A,D each have 1 product, B,C have 2 products.

The QVW I am working with is over a gig with information so I created a simple qvw.  I used status in my original QVW as a way to filter out customers that maybe have an open PO but have not yet purchased a product.

Not applicable
Author

i just did a reload and updated the applciaiton - you may run into an issue with the distinct because you have 1 of each customer -

thie expressions are simpler than what you need to do based on your ture model but hopefully this will help

hic
Former Employee
Former Employee

I would do an expression search (The Expression Search) inside the Set Analysis:

Count({$<Customer={"=Count(distinct Product)>1"}>} distinct Customer )

HIC

Anonymous
Not applicable
Author

Thank you both for your suggestions.  Very Helpful!