Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
This is one way to do it:
Sum({$<Product={'A'}> - 1<Category={'ABC'}>} Qty)
This is one way to do it:
Sum({$<Product={'A'}> - 1<Category={'ABC'}>} Qty)
cool thanks Goran
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)
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