Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Intersection in set analysis

Hi,

I am trying to develop report showing all suppliers belonging to two Diversity Categories:

Sum({$<[DIVERSITY DEFINITION]={'SMALL BUSINESS'} AND {'DISADVANTAGED BUSINESS'}>}[Line Amount])

The "AND" operator as used above does not work ofcourse.

Please note that the expression:

Sum({$<[DIVERSITY DEFINITION]={'SMALL BUSINESS', 'DISADVANTAGED BUSINESS'}>}[Line Amount])


is an "OR" operation which includes all Vendors with either Diversity Definition. This is not what I need.


Thank you!

5 Replies
robert_mika
Master III
Master III

Do you have both of the categories in the same Dimension(column)?

Like:

[DIVERSITY DEFINITION]

some text...SMALL BUSINESS', 'DISADVANTAGED BUSINESS..

....

...SMALL BUSINESS', 'DISADVANTAGED BUSINESS some text...


It would make sense for me if your categories SMALL BUSINESS', 'DISADVANTAGED BUSINESS where spread out into two dimensions and then you want  use AND.

Not applicable
Author

Robert,

Yes both belong to the same Dimension [Diversity Definition].

Unfortunately its not possible for me to split them out because there are 10-15 different [Diversity Definitions].

maxgro
MVP
MVP

2 ideas

sum({$ <Supplier={"=count({$ <[DIVERSITY DEFINITION]={'SMALL BUSINESS','DISADVANTAGED BUSINESS'}>} distinct [DIVERSITY DEFINITION])=2"}>}  [Line Amount])

if(concat(DISTINCT [DIVERSITY DEFINITION], '@')='DISADVANTAGED BUSINESS@SMALL BUSINESS',

     sum([Line Amount])

)

jaimeaguilar
Partner - Specialist II
Partner - Specialist II

how about:

Sum({$<[DIVERSITY DEFINITION]={'SMALL BUSINESS'}>*<{'DISADVANTAGED BUSINESS'}>} [Line Amount])


regards

Not applicable
Author

The first idea seems to be working in my test case. I will get back after I test it on my entire data.

Thank you!