# New to QlikView

Discussion board where members can get started with QlikView.

Not applicable

## What does -= mean in set analysis ?

Hi All,

Can someone explain what the following syntax does please ? I'm confused about the -= symbols in this expression.

(sum({\$<[Product Group] -= {'- Unknown}>} [Amount]))

Thanks

MV

1 Solution

Accepted Solutions
MVP

## Re: What does -= mean in set analysis ?

Hi

The -= is shorthand for:

Sum({<[Product Group] = {'*'} - {'- Unknown'}>} [Amount])

(ie include everything (*), but exclude '- Unknown'; or include everything except '- Unknown')

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
16 Replies
Esteemed Contributor

## Re: What does -= mean in set analysis ?

-=  means  NOT EQUAL TO

Vikas

MVP

## Re: What does -= mean in set analysis ?

-= means Not Equal to

(sum({\$<[Product Group] -= {'- Unknown}>} [Amount]))

SUM(Amount) where Product Group is not Equal to Unknown

MVP

## Re: What does -= mean in set analysis ?

In the mention expression

(sum({\$<[Product Group] -= {'- Unknown}>} [Amount]))

The symbol combination means  (-=) Not equals for the field it checks the values is not equals.

Regards,

Anand

Not applicable

## Re: What does -= mean in set analysis ?

Thanks Vikas. Isn't it better to use <> or is that different in some way ?

Not applicable

## Re: What does -= mean in set analysis ?

Hi,

-= Means Not equal to in set analysis

<> will not work in set analysis

Regards,

Joshmi

Not applicable

## Re: What does -= mean in set analysis ?

Oh really. But it can be used in the script though ?

## Re: What does -= mean in set analysis ?

<> will work in script

-= will work in set analysis.

Regards

ASHFAQ

Esteemed Contributor

## Re: What does -= mean in set analysis ?

Hi,

that I would NOT recommend using that:

=> Though it's more elegant, the script_editor does not recognize this, so it underlines it in red and doesn't check anything further down the line, so there's no way for you or anyone else to tell if everything else is correct.

<='> Instead I would suggest going the longer way and building an expression inside your set_expression,

sth. like

>> COUNT({<[date] = {"\$(= '<>' & [value])"}>} [field]) <<

Best regards,

DataNibbler

Highlighted
MVP & Luminary

## Re: What does -= mean in set analysis ?

Hi,

(sum({\$<[Product Group] -= {'- Unknown}>} [Amount]) ----------- -= in set analysis will exclude the given values in set analysis.

For example:

Year, Sales

2012, 100

2013, 150

2014, 200

sum({\$<Year -= {2013}>} Sales)  - this expression returns 300 (100 + 200) excluding the year 2013 values.

Simply saying

sum({\$<Year = {2012, 2013, 2014}>} Sales) - sum({\$<Year = {2013}>} Sales)

This cannot be used in Script, in script you can <>,

*

FROM Datasource

WHERE Year <> 2013;

Hope this helps you.

Regards,

Jagan.