Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

+(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

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

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

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

5 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

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

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

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

jonathandienst
Partner - Champion III
Partner - Champion III

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

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

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?


jonathandienst
Partner - Champion III
Partner - Champion III

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

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein