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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Andrey_Kosarev
Contributor II
Contributor II

Multiple Field Or condition Set analysis

Hi everyone! 

Is there anyway I can use an OR condition within the set analysis?

For example, if we have a table like this: 

attr1attr2amount
1a10
2b10
3c10
4d10

 

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?

Labels (2)
2 Replies
chrismarlow
Specialist II
Specialist II

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.

QFabian
MVP
MVP

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

Greetings!! Fabián Quezada (QFabian)
did it work for you? give like and mark the solution as accepted.