Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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
Specialist III
Specialist III

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

QFabian