Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi nice people,
I have a question regarding set analysis with operators.
I figured out how to use AND & OR Operators... here my simplified solution:
AND (show customer with customerID 1234 that bought Product A):
=SUM({< [CustomerID] = {'1234'}> * < [Product] = {'A'}> }[Values])
OR (show everything that is Product A or Product B:
=SUM({< [Product] = {'A'}> + < [Product] = {'B'}> }[Values])
HOWEVER, when I combine them to select Customer with ID 1234 that bought Product A or Product B something doesn't work out 😉 - what did I do wrong
??? =SUM({< [CustomerID] = {'1234'}> * < [Product] = {'A'}> + < [Product] = {'B'}>}[Values]) ???
Can you please help me 🙂 thx
all the best
george
If you want to combine multiple AND's and OR's you need to use appropriate brackets. And this is within a set analysis not different to any other expression, usually applied within if-loops, like:
SUM({< [CustomerID] = {'1234'}> * (< [Product] = {'A'}> + < [Product] = {'B'}>)}[Values])
Whereby if I understand your target right it could be done easier respectively more "classical" in regard to the common used syntax, like:
SUM({< [CustomerID] = {'1234'}, [Product] = {'A','B'}>}[Values])
- Marcus
If you want to combine multiple AND's and OR's you need to use appropriate brackets. And this is within a set analysis not different to any other expression, usually applied within if-loops, like:
SUM({< [CustomerID] = {'1234'}> * (< [Product] = {'A'}> + < [Product] = {'B'}>)}[Values])
Whereby if I understand your target right it could be done easier respectively more "classical" in regard to the common used syntax, like:
SUM({< [CustomerID] = {'1234'}, [Product] = {'A','B'}>}[Values])
- Marcus
Legend! thank you so much!!!