Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Hi
The -= is shorthand for:
Sum({<[Product Group] = {'*'} - {'- Unknown'}>} [Amount])
(ie include everything (*), but exclude '- Unknown'; or include everything except '- Unknown')
HTH
Jonathan
-= means NOT EQUAL TO
Vikas
-= means Not Equal to
(sum({$<[Product Group] -= {'- Unknown}>} [Amount]))
SUM(Amount) where Product Group is not Equal to Unknown
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
Thanks Vikas. Isn't it better to use <> or is that different in some way ?
Hi,
-= Means Not equal to in set analysis
<> will not work in set analysis
Regards,
Joshmi
Oh really. But it can be used in the script though ?
<> will work in script
-= will work in set analysis.
Regards
ASHFAQ
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
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.