Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Uploads getting stuck in the virus scanner. We are investigating.
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor II
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))

1 Solution

Accepted Solutions
Highlighted

Or this

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

View solution in original post

3 Replies
Highlighted

May be this

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

Highlighted

Or this

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

View solution in original post

Highlighted
Contributor II
Contributor II

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