12 Replies Latest reply: Oct 7, 2015 8:09 AM by nagarjuna k

# Selection in Set Analysis

Hi, QlikView community

I have a formula in set analysis:

Sum({\$<Region ={‘South’, 'North', 'East'}>} Sales)

In my dataset I have South, North, East and West.

So in my set analysis I do not want have information regarding West.

But here is my problem. I want to select South and look at data regarding South.

But I can't do that if my set analysis is like that.

Do you have any idea how to do that

regards Darri

• ###### Re: Selection in Set Analysis

Sum({\$<Region =e({‘West’})>} Sales)

• ###### Re: Selection in Set Analysis

ok, Gowtham

But if I have dataset with millions of value and I only want three.

How can I do that.

It will take hours to exclude every value that I do not want

• ###### Re: Selection in Set Analysis

then create a new field in the script match that three with match() function and make it null

• ###### Re: Selection in Set Analysis

I can't do anything in the expression?

I have to it in the script?

• ###### Re: Selection in Set Analysis

Perhaps if you explain a little more what it is you're trying to do?

Your first posting sounded like there were only four distinct values.

With that I would use;

Sum({\$<Region -={‘West’}>} Sales)

• ###### Re: Selection in Set Analysis

you can do it in expression

....

...

from tablename where match(region,'West')=0;

• ###### Re: Selection in Set Analysis

Have you tried Gowtham's expression ?

Set Analysis can be surprisingly quick and efficient.

• ###### Re: Selection in Set Analysis

Hi Darri,

Can u check the Region Names are Like East,West,North,South Or not.I mean Case sensitive?

Regards,

Nagarjna

• ###### Re: Selection in Set Analysis

Try like:

Sum({\$<Region ={‘South’, 'North', 'East'}> * <Region=\$::Region>} Sales)

• ###### Re: Selection in Set Analysis

Hi, I sent a dataset and qlikview document to let everybody see what I am taking about.

The two set analysis work:

1. Sum({\$<Region -={‘West’}>} Sales)

2. Sum({\$<Region =e({‘West’})>} Sales)

But I am trying to find set analysis that exclude everything except South, North and East.

Because in other dataset I have there are more values then in this dataset

And I can select South or North or East in my selections.

• ###### Re: Selection in Set Analysis

Aaah!  I think I understand your question now, try :

Sum({\$<Region *= -{"West"}>} Sales)

• ###### Re: Selection in Set Analysis

Then it is a union you are looking for.

The selected values in Region but only those that intersect with South, North or East.

Sum({\$<Region *={‘South’, 'North', 'East'}>} Sales)