# QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
MVP

## negation operator ~ in set anlysis

Hi all,

Negation operator ~ is not working in set analysis for me. Is it a common problem or its an error

from my end ?

i am using SUM( { \$ < ~Name = { Amit } > } Sales) to calculate the total sales for current selection

but forcefully excluding the Sale for the Name "Amit".

But it's not working!

Any input is appreciated .

With Regards,

tresesco

Tags (1)
7 Replies
Not applicable

## negation operator ~ in set anlysis

Hi

You can try this :

SUM( { \$ < Name = -{ Amit } > } Sales)

Not applicable

## negation operator ~ in set anlysis

Hi,

the correct syntax are:

Sum({\$<Country-={GERMANY}>}LineSalesAmount)

Good luck!

Rainer

MVP

## negation operator ~ in set anlysis

Thanks guys for your inputs. I knew that the alternatives. But the question is, "~" operator is not working. Is it so, that it does not work in QV? Can someone please confirm it?

Not applicable

## negation operator ~ in set anlysis

That´s what QV help says:

### Set Operators

Several set operators that can be used in set expressions exist. All set operators use sets as operands, as described above, and return a set as result.

+ Union. This binary operation returns a set consisting of the records that belong to any of the two set operands.

- Exclusion. This binary operation returns a set of the records that belong to the first but not the other of the two set operands. Also, when used as a unary operator, it returns the complement set.

* Intersection. This binary operation returns a set consisting of the records that belong to both of the two set operands.

/ Symmetric difference (XOR). This binary operation returns a set consisting of the records that belong to either, but not both of the two set operands.

The order of precedence is 1) Unary minus (complement), 2) Intersection and Symmetric difference, and 3) Union and Exclusion. Within a group, the expression is evaluated from left to right. Alternative orders can be defined by standard brackets, which may be necessary since the set operators do not commute, e.g. A+(B-C) is different from (A+B)-C which in turn is different from (A-C)+B.

That´s it.

Rainer

MVP

## negation operator ~ in set anlysis

Hi Rainer,

QV help even says this:

sum( {\$<~Ingredient = {"*garlic*"}>} Sales )
returns the sales for current selection, but with a forced exclusion of all Ingredients containing the string 'garlic'.

Not applicable

## negation operator ~ in set anlysis

In this case it´s a question to ask QT support.

Not applicable

## negation operator ~ in set anlysis

As explained by the marvellous Mr Witherspoon over in

http://community.qlik.com/message/77207

the ~ only applies to fields in 'and-mode' whatever that is..