5 Replies Latest reply: Jun 10, 2012 2:19 PM by Jonathan Dienst

# +(sum(Aggr(sum({\$<%_AccountNumberIDKey /= {'52','53'}>}

can someone help clarify what is going on here?

+(sum(Aggr(sum({\$<%_AccountNumberIDKey /= {'52','53'}>}

IF((%_AccountNumberIDKey <> 52 or %_AccountNumberIDKey <> 53) and [Logistics Fee] > 0 and [Logistics Fee] <= 0.12,Sales,0))*([Logistics Fee]),DebtorName,ItemDescription))*0.5)

specifically what is going on with:

/=

in the first line of the expression

• ###### Re: +(sum(Aggr(sum({\$<%_AccountNumberIDKey /= {'52','53'}>}

Hi

/= is the exclusive OR (XOR or symmetric difference) operator. It returns those members of each set which do not exist in the other set. In this contexm the current selection is one set, and the bracketted expression {'52','53'} is the other.

Hope that helps

Jonathan

• ###### +(sum(Aggr(sum({\$<%_AccountNumberIDKey /= {'52','53'}>}

so in this case the exclusive OR returns everything except '52' and '53' ? Is that right?

• ###### Re: +(sum(Aggr(sum({\$<%_AccountNumberIDKey /= {'52','53'}>}

Chris

It will return everything in the current selection (the \$ sign) other than 52, 53. It will also return either or both those two values if they don't exist in the selection. In other words, it will include everything that exists either in the selection, or in 52,53 - but not both.

Is that a little clearer?

Jonathan

• ###### +(sum(Aggr(sum({\$<%_AccountNumberIDKey /= {'52','53'}>}

yes, that is a little clearer I think.

Just need a little more clarification please.

you state:

"it will also return either or both those two values if they don't exist in the selection"

do you mean either 52 or 53, or both 52 and 53

OR are you referring to the current selection as one value and 52, 53 as another value

So does that mean if there is no selection, it automatically includes 52,53 but nothing else?

Or is it saying for example if 52 is selected it will include 53 as well, but nothing else?

• ###### Re: +(sum(Aggr(sum({\$<%_AccountNumberIDKey /= {'52','53'}>}

If the selection contains 1, 2, 3; the expression will return 1, 2, 3, 52, 53

If the selection contains 1, 2, 52; the expression will return 1, 2, 53  (52 is in both sets so it is excluded)

If the selection contains 1, 2, 53; the expression will return 1, 2, 52   (53 is in both sets so excluded)

If the selection contains 1, 2, 52, 53; the expression will return 1, 2

Google Exclusive Or (XOR) for more