Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone!
Is there anyway I can use an OR condition within the set analysis?
For example, if we have a table like this:
attr1 | attr2 | amount |
1 | a | 10 |
2 | b | 10 |
3 | c | 10 |
4 | d | 10 |
I'd like to find the sum of the amount for those rows, there attr1 = a OR attr 2 = c
is there any way I can do it?
Hi,
'+' is union in set analysis, so something like;
{<attr1={'a'}>+<attr2={'c'}>}
(Note in your data attr1 is never a ... is 1-4)
Cheers,
Chris.
Hi @Andrey_Kosarev , please try this :
sum({<attr1={'2'}> + <attr2={'c'}>} amount) // with set analysis
sum(if(attr1 = '2' or attr2 = 'c', amount)) // with if