Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

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

Re: Intersection in set analysis

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

Re: Intersection in set analysis

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].

MVP
MVP

Re: Intersection in set analysis

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
Valued Contributor II

Re: Intersection in set analysis

how about:

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


regards

Not applicable

Re: Intersection in set analysis

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!

Community Browser