Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

exclusion in set analysis

Hi

I have a table which looks like this

Field_AField_B

a

A
bA
cA
dA
eA
fA
aB
bB
cB

I want the list of Field_A items which are A but not B (which would be here "def")

I was thinking of doing something like :

=concat( {<Field_B={"A"} > -   <Field_B={"B"}> }   DISTINCT Field_A)


But it doesn't seem to work :

it returns "abcdef" instead of "def"

Could you help me out ?

Thanks !

1 Solution

Accepted Solutions
sunny_talwar

May be like this:

=Concat({<Field_A = P({<Field_B = {'A'}>}) - P({<Field_B = {'B'}>})>} DISTINCT Field_A)


Capture.PNG

View solution in original post

11 Replies
sunny_talwar

May be like this:

=Concat({<Field_A = P({<Field_B = {'A'}>}) - P({<Field_B = {'B'}>})>} DISTINCT Field_A)


Capture.PNG

Not applicable
Author

That's it thanks a lot for your help !

sunny_talwar

No problem at all

vishsaggi
Champion III
Champion III

Try this:

Table1:

LOAD * INLINE [

Field_A, Field_B

a,  A    

b, A

c, A

d, A

e, A

f, A

a, B

b, B

c, B

];

JOIN(Table1)

LOAD DISTINCT Field_A,

     Field_B

Resident Table1

WHere Field_B <> 'B';

maxgro
MVP
MVP

maybe

=Concat({$ <Field_B={A},Field_A={"=count(distinct Field_B)=1"}>} Field_A)

Not applicable
Author

Sunny T,

Let's say, I have another Field, Filed_C, and i want to disregard any selection made in that field.

I tried both this formulas, but it doen't to what expected.

Any idea ?

=Concat({<Field_A = P({<Field_B = {'A'} , Field_C= >}) - P({<Field_B = {'B'}> , Field_C= })>} DISTINCT Field_A)


=Concat({< Field_C=, Field_A = P({<Field_B = {'A'} >}) - P({<Field_B = {'B'}>  })>} DISTINCT Field_A)

sunny_talwar

Try this:

=Concat({<Field_A = P({<Field_B = {'A'}>}) - P({<Field_B = {'B'}>}), Field_C=>} DISTINCT Field_A)

Not applicable
Author

Hey

Unfortunately it doesn't work.

Your last formula has the same result as your first formula when I do a selection on Field_C

sunny_talwar

How about this:

=Concat({<Field_A = P({<Field_B = {'A'}, Field_C>}) - P({<Field_B = {'B'}, Field_C>}), Field_C=>} DISTINCT Field_A)