Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

set analysis for for multiple conditions of the same field

I would like to write a set analysis that shows me where a range of values DOES occur in table_1, field_a and  DOES NOT have another range of in the same tabe and field.  For example, Account ABC has an installed product listing like:

For example, I want to see every account here that has product 234 or 789, but does not have product 12345 or 345.

Meyer - NO, has 234 but also has 12345 - ignore.

Adams - YES, has 234 and does not have 12345 or 345

Jones - NO, has 234 and 789 but also has 12345

Smith - YES, 789 but does not have 12345 or 345

AccountInstalled_Product

Meyer

12345
Meyer6789
Meyer234
Adams234
Adams6789
Jones12345
Jones6789
Jones789
Jones234
Smith789
Smith567
1 Solution

Accepted Solutions
erichshiino
Partner - Master
Partner - Master

Hi,

You need to operate with at least two sets.

The final set analysis would be more or less like this:

{<Installed_Product={234,789}>-<Installed_Product={12345,345}>}

For instance, to calculate the number of account that are the result of the difference between those two sets, you can use  count( {<Installed_Product={234,789}>-<Installed_Product={12345,345}>} distinct Account)

Hope it helps,

Erich

View solution in original post

4 Replies
swuehl
MVP
MVP

Try something like

only({<Account = p({<Installed_Product={234,789}>}) - p({<Installed_Product= {12345,345}>}) >} Account)

erichshiino
Partner - Master
Partner - Master

Hi,

You need to operate with at least two sets.

The final set analysis would be more or less like this:

{<Installed_Product={234,789}>-<Installed_Product={12345,345}>}

For instance, to calculate the number of account that are the result of the difference between those two sets, you can use  count( {<Installed_Product={234,789}>-<Installed_Product={12345,345}>} distinct Account)

Hope it helps,

Erich

Anonymous
Not applicable
Author

Bingo - Thanks!

Anonymous
Not applicable
Author

12345, 345 need to be '12345, '345'...