Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
jduluc12
Creator
Creator

Set Analysis Exclusion question

Hi,

My data set looks like this.

[a]:
LOAD * INLINE [
ID, Type
1, S
2, S
3, C
4, S
5, S
6, C
22, S
];

NoConcatenate
[b]:
LOAD * INLINE [
ID, SNN
1, AAA
2, BBB
3, AAA
4, FFF
5, GGG
6, FFF
22, III
];

I want to find all SNN which are connected to Type 'S' but not with Type 'C'. 

In this data set, there are 3 such SNN.

  • BBB
  • GGG
  • III 

I am writing an exclusion set analysis.

=Concat({<Type={'S'}> -  <Type={'C'}>}SNN, ',') 

and it returns all SNNs.

AAA, BBB, FFF, GGG, III.

What am I doing wrong here?

 

 

Labels (2)
1 Solution

Accepted Solutions
ngioux
Partner - Contributor II
Partner - Contributor II

Hi,

 

Your formula is an equivalent to filter rows in the table "a" and then looking for corresponding values in the table "b" (so all SNN values linked to Type 'S').

To achieve what you want, I suggest to filter directly on the SNN field, using P() function (see https://help.qlik.com/en-US/sense/September2019/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/SetA...) :

=Concat({$<[SNN] = P({$<[Type] = {"S"}>} [SNN])-P({$<[Type] = {"C"}>} [SNN])>} [SNN], ',')

 

Hope this helps you.

Best regards,

Nicolas

View solution in original post

2 Replies
ngioux
Partner - Contributor II
Partner - Contributor II

Hi,

 

Your formula is an equivalent to filter rows in the table "a" and then looking for corresponding values in the table "b" (so all SNN values linked to Type 'S').

To achieve what you want, I suggest to filter directly on the SNN field, using P() function (see https://help.qlik.com/en-US/sense/September2019/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/SetA...) :

=Concat({$<[SNN] = P({$<[Type] = {"S"}>} [SNN])-P({$<[Type] = {"C"}>} [SNN])>} [SNN], ',')

 

Hope this helps you.

Best regards,

Nicolas

jduluc12
Creator
Creator
Author

This also worked

 

=Concat({<SNN=E({<Type={'C'}>})>}SNN, ',')