Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator
Creator

Intersection in two alternate states

Hello all,

I have a simple inline data:

test:

LOAD * INLINE [

  PLACE, VALUE

  A, 4

  A, 5

  A, 6

  A, 7

  A, 8

  B, 1

  B, 2

  B, 3

  B, 4

  B, 5

  B, 9

]; 

then I created two alternate states ([Group 1] and [Group 2].  I want to count the number of "intersection(s)' in dimension PLACE between the two alternate states. In the data (A and B), they have two the same values (4 and 5).  I tried some script (below) from a comment from another thread

=Count({[Group 1]<PLACE*=p({$}PLACE::PLACE)> * [Group 2]<PLACE*=p({$}PLACE::PLACE)>} VALUE)

but it only displayed 0, not 2.  I have attached the image below:

intersection_in_two_alternate_states.jpg

Please check if I missed something or the code is wrong.

Thanks in advance and best regards,

Jason

1 Solution

Accepted Solutions
Highlighted
MVP
MVP

Re: Intersection in two alternate states

Hello Jason,

PFA.

Use expression: =Count({[Group 1]<VALUE=P({<PLACE=[Group 2]::PLACE>})>}VALUE)

View solution in original post

10 Replies
Highlighted
Not applicable

Re: Intersection in two alternate states

Hi Jason,

Can you attach your testing appication? That will be more understandable.

Thanks!!

Regards,

Yojas

Highlighted
Creator
Creator

Re: Re: Intersection in two alternate states

Hello Yojas,

thank you for a fast reply, please find attached the qvw for your checking.

best,

Jason

Highlighted
Not applicable

Re: Intersection in two alternate states

Hi

PFA hope it will help you

Highlighted
Creator
Creator

Re: Intersection in two alternate states

Hello Nirmal,

Thanks for the qvw file.

However, there are only two data from A and B that are the same (4 & 5), how come your script yielded 11?

best,

Highlighted
Not applicable

Re: Intersection in two alternate states

Sorry Jason after that i saw the exact requirement

Highlighted
Not applicable

Re: Re: Re: Intersection in two alternate states

Hi Jason,

PFA for your requirement.

I hope it hte same which you were expecting!!! 

Regards,

Yojas

Highlighted
MVP
MVP

Re: Intersection in two alternate states

Hello Jason,

PFA.

Use expression: =Count({[Group 1]<VALUE=P({<PLACE=[Group 2]::PLACE>})>}VALUE)

View solution in original post

Highlighted
Not applicable

Re: Re: Re: Intersection in two alternate states

Hi Jason,

Please update us if you got your solution by marking it correct !!!

Thanks!!

Regards,

Yojas

Highlighted
Creator
Creator

Re: Intersection in two alternate states

Hi tresesco,

it's correct, thank you very much.

best regards,

jason