Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Not applicable

Intersection in Set analysis

Hi Guys

I want to have the intersection values of two set expression in a straight table.

For example in the database i have CustId and Flag ( Flag values are 'Y' and 'N')

In a straight table i need CustId which are common in both the flags.

i.e. intersection of Count({<Flag = {'Y'}>}CustId) and Count({<Flag = {'Y'}>}CustId)....

Please help......................

1 Solution

Accepted Solutions

Re: Intersection in Set analysis

HI

Sorry, That not works

=Count({<CustID = {"=Count(Distinct Flag)=2"}>}CustID)

Hope it helps

7 Replies

Re: Intersection in Set analysis

HI

I think you want like this

=Count({<Flag = {'Y'}>*<Flag={'N'}>}CustId)

Hope it helps

Not applicable

Re: Intersection in Set analysis

hi Mayil

Thanks for the reply but i also used the same expression but i am not getting the result ...

can you please send me a demo application .... it will be a great help.....

Re: Intersection in Set analysis

HI

Sorry, That not works

=Count({<CustID = {"=Count(Distinct Flag)=2"}>}CustID)

Hope it helps

Not applicable

Re: Intersection in Set analysis

Hi Mayil

thanks a lot  .. it worked .......but i have a 2 questions for you

First >>>>   Why =Count({<Flag = {'Y'}>*<Flag={'N'}>}CustId) did not worked??? because

=Count({<Flag = {'Y'}>+<Flag={'N'}>}CustId) and =Count({<Flag = {'Y'}>-<Flag={'N'}>}CustId) are working fine....................

Second>>>>>>>>>>>>>Suppose i have following  Expressions

Count( {<Status = {'Pending'},ItemType = {'A'}>}    ID)

and

Count( {<Status = {'Ready'},ItemType = {'B'}>}  ID)

now how can i get the common Count of ID............i.e. Intersection between 2 expressions

Thanks in advance.......

Re: Intersection in Set analysis

Hi

If custId and Flag are in different table, then '*' works, if both fields are in same table, then it not works. please check attached file..

Table1:

CustID,Flag

1,Y

1,N

2,Y

In this,

=Count({<Flag = {'Y'}>*<Flag={'N'}>}CustID)

It check the row wise, so for a custID , no possibility for have both Y and N in same row.. so its result zero..

I think you understand what am saying..

Not applicable

Re: Intersection in Set analysis

thanks a lot for clearing my concepts......

Can you please also tell me about my second question ... how to do that ????

Re: Intersection in Set analysis

HI

I think, its correct method or not, but its help u

Community Browser