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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis Expression

Hi All,

I have a requirement to identify all the sales with a particular product type. Can you please help me to write a set analysis expression. I have tried many but couldn't achieve my requirement. Here is an example:

OrderProduct TypeSales
Order1Stationary200
Order1Drinks50
Order2Drinks30
Order3Drinks40

In my requirement I want to identify all the sales with only drinks in them. So my expression output has to be Order2+Order3=70.

Thanks,

mc

15 Replies
anbu1984
Master III
Master III

=Sum({1<order=e({1<[Product Type]-={'Drinks','Stationary'}>}order)>} Sales)

Here Result of [Product Type]-={'Drinks','Stationary'} is empty and e({1<[Product Type]-={'Drinks','Stationary'}>}order gives all orders. Hence the result is 320



Fetch sales with Drinks and Stationary

=Sum({<order=P({<[Product Type]={'Drinks'}>}order)>*<order=P({<[Product Type]={'Stationary'}>}order)>} Sales)

Not applicable
Author

Hi

Hope it will help

=sum({<order=P({<[Product Type]={'Drinks','Stationary'}>}order)>}sales)

Not applicable
Author

Sorry Shweta Singh your expression didn't work. It returns 320.

Not applicable
Author

Hi, anbucheliyan's expression should be able to resolve your other questions. Do you have any other questions?

Not applicable
Author

Thank you Ramkumar Ramagopalan . I have few more questions , I will post them soon.

One gain thank you so much for your help.

Thanks,

Mc

Not applicable
Author

Hi, I hope this may help you

Sum(cost) - if(aggr(count(product_s),order_id)>1,sum(cost),0)