Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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

Accepted Solutions
erich_shiino
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
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)

erich_shiino
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

jhlovenc
Contributor II

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

Bingo - Thanks!

jhlovenc
Contributor II

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

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

Community Browser