Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
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
jonathandienst
Partner - Champion III
Partner - Champion III

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

View solution in original post

16 Replies
vikasmahajan

-=  means  NOT EQUAL TO

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
MK_QSL
MVP
MVP

-= means Not Equal to

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


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

its_anandrjs

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
Author

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

Not applicable
Author

Hi,

-= Means Not equal to in set analysis

<> will not work in set analysis

Regards,

Joshmi

Not applicable
Author

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

ashfaq_haseeb
Champion III
Champion III

<> will work in script

-= will work in set analysis.

Regards

ASHFAQ

datanibbler
Champion
Champion

Hi,

adding to all those answers, I can only say

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

jagan
Luminary Alumni
Luminary Alumni

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 <>,


LOAD

*

FROM Datasource

WHERE Year <> 2013;



Hope this helps you.


Regards,

Jagan.