Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sales by customer who purchase package of products....should be simple

Hi Community,

I am trying to do something that i think should be simple but I can not to get it to work...

I want to get a list of sales by customers who purchased a minimum of 3 out of 4 products. Whether it be A,B,C, or A,B,D, or A,C,D, or B,C,D.

OR simply an expression that will give me customers who purchased the package of A and B and C, and then I can just run it four times and then manipulate the data for unique names only.

I do not want A or B or C. All three must be met.

5 Replies
Anonymous
Not applicable
Author

Calculated list box with this expression should work:
aggr(only(if(count(distinct Product)>=3, Customer)),Customer)

Edit:
If you want sales (or whatever else) for these customers, use the above expression as calculated dimension in a chart (for example straight table). Don't forget to "suppress when value is null. Use sum(sales) as expression.

Not applicable
Author

The idea would be to then select 4 products at random from my list of products and the customer list box would only associate to those customers who purchased a minimum of three of them.

I tried your suggestion and I do not believe it worked. When I made my selection of products it only looked for one of these products and ANY other 3 (regardless of whether I selected them or not),

Anonymous
Not applicable
Author

Les,
I don't see a reason for this not to work. Either you did something differently, or the scenario is a little more complex than you've described. If you upload application or at least data model it may help to understand the issue better.

Not applicable
Author

Not sure why it did not work. I ended up using expression below in a chart with customer as dimension. Even though it is probably not the best way it still worked...my intention was not to get the sales amount at the same time but it still gives me the list of customers

if

(count(distinct product)>=3, sum(sales),0) ;





Anonymous
Not applicable
Author

I think it would be better to use calculated dimension, but whatever works for you is fine. Close enough... Smile