Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

pnutbutta
New Contributor II

Using P() with multiple criteria

Is it possible to use P() to show a set that has multiple criteria in the formula? In my case looking for customers that each purchase all three products. I do not want in this group customers that only purchase 1 or 2 products. Only customers have purchase all three.

Sum({$<CustomerName=P({1<Product={'1016'},{'2016'},{'1032'}>}CustomerName)>}(Qty))

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Re: Using P() with multiple criteria

Or this

Sum({$<CustomerName = {"=Count(DISTINCT {<Product = {'1016', '2016', '1032'}>} Product) = 3"}>} Qty)

3 Replies
MVP
MVP

Re: Using P() with multiple criteria

May be this

Sum({$<CustomerName=P({1<Product={'1016'}>})*P({1<Product={'2016'}>})*P({1<Product={'1032'}>})>}(Qty))

MVP
MVP

Re: Using P() with multiple criteria

Or this

Sum({$<CustomerName = {"=Count(DISTINCT {<Product = {'1016', '2016', '1032'}>} Product) = 3"}>} Qty)

pnutbutta
New Contributor II

Re: Using P() with multiple criteria

Thanks Sunny. This is exactly what I was hoping for.