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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

two subsets - i need the intersection

Hi at all,

i have following question:

I have two Dimension with results:

Example:

DimensionADimensionB
AL
BK
CR
DA
EX
FC
GA

I need a Count of the Intersection between Dimension A and Dimension B:

For this Example it is A - A, C - C and A - A. I need to count the distinct pairs. In this example the Distinct Count = 2 becaus A - A and C - C.

Which formula is correct?

I tried something like this without success:

"COUNT( ({<DimensionA>*<DimensionB>}) DISTINCT DimensionA)

Thank You!!!!

6 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Both the fields are in same table?

Not applicable
Author

yes

mdmukramali
Specialist III
Specialist III

Dear kstyles089,

Try the below two expressions

1)

=count({<DimensionA={"=count({< DimensionB=P(DimensionA)>}distinct DimensionA)>0"} > }distinct DimensionB)

2)

=count({<DimensionB={"=count({< DimensionA=P(DimensionB)>}distinct DimensionB)>0"} > }distinct DimensionA)

kindly find the attachment.

I hope it will help you.

Thanks,

Mukram.

Not applicable
Author

Dear Mukram,

thanks a lot!

But sry... My mistake. The two dimension are not in one table.

The Tableview looks like following example:

table.JPG

so your expression doesn`t work. Do you have a solution for this problem?

thanks, kstyles089


mdmukramali
Specialist III
Specialist III

Dear kstyles089,

can you attach the sample file.

Thanks,

Mukram

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

I hope the attachment helps