Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
jvitantonio
Luminary Alumni
Luminary Alumni

Set analysis intersection

Hi everyone. I've been trying different formulas to achieve what I want but didn't succeed.

It's very simple. I have a list of codes and exams.

codeexam
A1
A2
A3
B1
C2
D5

Now, I need to count only those codes that have in exam at least values 1 AND 2. The outcome in this case should be 1 because code A is the only code containing 1 AND 2 among its exams.

Any thoughts?

Thanks!

1 Solution

Accepted Solutions
Not applicable

i think you could have tried a bit more with the exemple i sent to you:

=count (distinct  {<code = P ({<exam={"1"}>} code ) >*<code = P ({<exam={"2"}>} code ) > } code )

View solution in original post

6 Replies
mutuverria
Contributor
Contributor

Hi! Try it

Aggr(Count( {$<exam = {1,2}>} code), exam)

Not applicable

Hello,

try

sum( {<code = P ({<exam={"1"}>} code ) >*<code = P ({<exam={"2"}>} code ) > } exam )

jvitantonio
Luminary Alumni
Luminary Alumni
Author

Thank you guys for your valuable time. Unfortunatly non of your solutions work. I need to show the result (in this case is 1) in a text object so I make sure the solution works.

Any other ideas?

Not applicable

i think you could have tried a bit more with the exemple i sent to you:

=count (distinct  {<code = P ({<exam={"1"}>} code ) >*<code = P ({<exam={"2"}>} code ) > } code )

jvitantonio
Luminary Alumni
Luminary Alumni
Author

Thank you baptiste! It works now

mukesh19
Contributor II
Contributor II

Hi MARCHAND,

I to have the same problem but I need code rather than the count in the above expression. Can u please help me in achieving it.

Thanks in Advance,

Mukesh