Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

QSense
Contributor II

intersect two fields

Hello everyone ,

I have a question about intersection . İn set analysis with element fucntion p It can be done but

I couldnt .

I have two fields and I would like to count two fields's intersection

A and B are fields

I want count(A intersects B)

5 Replies
Not applicable

Re: intersect two fields

Hi,

The intersection is done by the the star : *

count({{A} * {B}}, xxx)

where {A} and {B} are two sets.

Fabrice

somenathroy
Contributor III

Re: intersect two fields

Count(DISTINCT{<A=P(B)>}A)

Regards,

Som

QSense
Contributor II

Re: intersect two fields

When I take your script into my qw file,

It gives not responding error

Not applicable

Re: intersect two fields

Count(A&B)

somenathroy
Contributor III

Re: intersect two fields

P(B) returns all possible values of field B. If your table contains huge amount of records, it may arise considerable performance issue. So according to requirements you may impose some conditions through set within P() func, like Count(DISTINCT{<A=P({<Date={'$(=Max(Date))'}>}B), Date={'$(=Max(Date))'}>}A)

Regards,

som

Community Browser