Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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:
Order | Product Type | Sales |
---|---|---|
Order1 | Stationary | 200 |
Order1 | Drinks | 50 |
Order2 | Drinks | 30 |
Order3 | Drinks | 40 |
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
=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)
Hi
Hope it will help
=sum({<order=P({<[Product Type]={'Drinks','Stationary'}>}order)>}sales)
Sorry Shweta Singh your expression didn't work. It returns 320.
Hi, anbucheliyan's expression should be able to resolve your other questions. Do you have any other questions?
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
Hi, I hope this may help you
Sum(cost) - if(aggr(count(product_s),order_id)>1,sum(cost),0)