Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi!
I'm looking for a way to cleverly count customers who bought AT LEAST x products (e.g. 2, or 5 - freely programmable) from the list during ONE TRANSACTION.
So - what do I have:
1) A list of products to be taken into account. /ProdID/
2) A table with sales. /Date, TransID, CustID, ProdID, Qty, Sales/
I know that I can group it appropriately, throw out only the sales of these products from the list, add a column with the flag '1' and count at the end. However, I'm looking for a "smarter" way. Maybe someone could suggest something?
Thanks! I'll try.
How about:
MultiCust:
Load *
Where ProductCount >= 2
;
Load
CustID,
Count(Product) as ProductCount
Resident Data
Group By TransId, CustID
;
-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com
Thanks for Your proposal!
This probably won't give the expected result, for two reasons:
1) It is supposed to count customers who bought at least X products in one order.
2) These at least X products are supposed to apply to a precisely defined group of products.
I did it in load script, similar to @ Qrishna. I wanted it to be in LS. The example with "Window" is interesting!