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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
deepakk
Partner - Specialist III
Partner - Specialist III

Inclusing and Excluding data using Set Analysis

Hi All,

I have data with Three fields Product, Category and Qty. I need to see sum of Qty where Product = A and Category <> ABC.

I have achieved the same using If statement but I want to use Set analysis to achieve the same.

I am attaching a sample application.

Please provide you valuable inputs on the same.

1 Solution

Accepted Solutions
gandalfgray
Specialist II
Specialist II

This is one way to do it:

Sum({$<Product={'A'}> - 1<Category={'ABC'}>} Qty)

View solution in original post

4 Replies
gandalfgray
Specialist II
Specialist II

This is one way to do it:

Sum({$<Product={'A'}> - 1<Category={'ABC'}>} Qty)

deepakk
Partner - Specialist III
Partner - Specialist III
Author

cool thanks Goran

johnw
Champion III
Champion III

This should be a little more efficient since it's only one set instead of one set minus another set. Probably won't make much practical difference, though.

sum({<Product={'A'},Category-={'ABC'}>} Qty)

Not applicable

Thanks you John, i was looking for something similar (for +10 categories).

My application is like this (just if someone needs to exclude/include more items)

sum({<Product={'A'},Category-={'ABC','XYZ'}>} Qty)       // excludes 'ABC','XYZ', leaved everything else

sum({<Product={'A'},Category={'ABC','DEF'}>} Qty)      // show only ABC and DEF

very clean and usefull

thanks,

Alex