# New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Contributor II

## 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
Jones12345
Jones6789
Jones789
Jones234
Smith789
Smith567
1 Solution

Accepted Solutions
Honored Contributor

## Re: set analysis for for multiple conditions of the same field

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

4 Replies
MVP

## Re: set analysis for for multiple conditions of the same field

Try something like

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

Honored Contributor

## Re: set analysis for for multiple conditions of the same field

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

Contributor II

Bingo - Thanks!

Contributor II

## Re: set analysis for for multiple conditions of the same field

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